Adapter: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
This block allows you to interact with non [[Advanced Computers]] blocks, such as the vanilla Minecraft jukebox, or blocks from other addon mods. It also offers special functionality for interacting with another [[Computer]]. The provided functionality changes based on the block that it is facing. | This block allows you to interact with non [[Advanced Computers]] blocks, such as the vanilla Minecraft jukebox, or blocks from other addon mods. It also offers special functionality for interacting with another [[Computer]]. The provided functionality changes based on the block that it is facing. | ||
== Provided component == | == Provided component == | ||
This block provides the <code>adapter</code> component, offering the following properties regardless of the block placed in front of it: | This block provides the <code>adapter</code> component, offering the following properties/methods regardless of the block placed in front of it: | ||
{| class="wikitable" | |||
|+AdapterUD component properties | |||
!Name | |||
!Type | |||
!Read/Write | |||
!Description | |||
|- | |||
|<code>uniqueId</code> | |||
|<code>integer</code> | |||
|READ | |||
|A unique numeric ID tied to this peripheral device, generated on block placement and persistent across restarts. | |||
|} | |||
{| class="wikitable" | {| class="wikitable" | ||
|+AdapterUD component methods | |+AdapterUD component methods | ||
| Line 90: | Line 104: | ||
|The crashReason that can also be read via the [[Debugger]]. | |The crashReason that can also be read via the [[Debugger]]. | ||
|} | |} | ||
=== ME Interface (Applied Energistics 2) === | === ME Interface (Applied Energistics 2) === | ||
Latest revision as of 02:18, 7 September 2026

This block allows you to interact with non Advanced Computers blocks, such as the vanilla Minecraft jukebox, or blocks from other addon mods. It also offers special functionality for interacting with another Computer. The provided functionality changes based on the block that it is facing.
Provided component
This block provides the adapter component, offering the following properties/methods regardless of the block placed in front of it:
| Name | Type | Read/Write | Description |
|---|---|---|---|
uniqueId
|
integer
|
READ | A unique numeric ID tied to this peripheral device, generated on block placement and persistent across restarts. |
| Name | Type | Description |
|---|---|---|
:getBlockName()
|
string
|
Returns the name of the block that it is facing at. E.g. minecraft:air or minecraft:jukebox.
|
The remaining properties / methods are only available when the adapter is facing the respective block.
Jukebox
| Name | Type | Read/Write | Description |
|---|---|---|---|
isPlaying
|
boolean
|
READ | Whether the jukebox is currently playing music. |
containedItem
|
string
|
READ | The name of the currently contained item, e.g. minecraft:music_disc_otherside.
|
recordName
|
string
|
READ | The fancy title of the music disc that is currently playing, e.g. Lena Raine - otherside.
|
| Name | Type | Description |
|---|---|---|
:restartPlaying()
|
void
|
Starts or restarts the current track. |
:eject()
|
void
|
Ejects the current music disc. |
Noteblock
| Name | Type | Read/Write | Description |
|---|---|---|---|
instrument
|
string
|
READ | The name of the instrument that this noteblock is representing. |
notePitch
|
int
|
READWRITE | The current pitch of the note that would be played. |
Computer (Advanced Computers)
| Name | Type | Read/Write | Description |
|---|---|---|---|
runState
|
string
|
READ | The computer's runstate, see Computer. |
crashReason
|
string
|
READ | The crashReason that can also be read via the Debugger. |
ME Interface (Applied Energistics 2)
| Name | Type | Description |
|---|---|---|
:search(partialName:string)
|
table
|
Returns a table of at most 1000 of the first items that match the given name. The keys of the table are the full item names and the associated values are the quantities of each item. |
:getCount(fullName:string)
|
int
|
Returns how much of the given item is available in the storage system. |
:extract(fullName:string, direction:int, maxQuantity:int)
|
int
|
Tries to push the given amount of the given item into the adjacent inventory on the side given by direction, relative to the interface block. Returns the actual quantity that was extracted.
|