Adapter: Difference between revisions
Appearance
Created page with "alt=Adapter block|thumb|Adapter block 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 <code>adapter</code> component, offering the following propert..." |
No edit summary |
||
| Line 89: | Line 89: | ||
|READ | |READ | ||
|The crashReason that can also be read via the [[Debugger]]. | |The crashReason that can also be read via the [[Debugger]]. | ||
|} | |||
== Future content == | |||
{{Future Content}} | |||
=== ME Interface (Applied Energistics 2) === | |||
{| class="wikitable" | |||
|+ME Interface methods | |||
!Name | |||
!Type | |||
!Description | |||
|- | |||
|<code>:search(partialName:string)</code> | |||
|<code>table</code> | |||
|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. | |||
|- | |||
|<code>:getCount(fullName:string)</code> | |||
|<code>int</code> | |||
|Returns how much of the given item is available in the storage system. | |||
|- | |||
|<code>:extract(fullName:string, direction:int, maxQuantity:int)</code> | |||
|<code>int</code> | |||
|Tries to push the given amount of the given item into the adjacent inventory on the side given by <code>direction</code>, relative to the interface block. Returns the actual quantity that was extracted. | |||
|} | |} | ||
{{Navbox content}} | {{Navbox content}} | ||
Revision as of 05:38, 31 August 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 regardless of the block placed in front of it:
| 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. |
Future content
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.
|