Jump to content

Adapter: Difference between revisions

From Advanced Computers Wiki
No edit summary
No edit summary
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

Revision as of 02:12, 7 September 2026

Adapter block
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 adapter component, offering the following properties/methods regardless of the block placed in front of it:

AdapterUD component properties
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.
AdapterUD component methods
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

Jukebox properties
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.
Jukebox methods
Name Type Description
:restartPlaying() void Starts or restarts the current track.
:eject() void Ejects the current music disc.

Noteblock

Noteblock properties
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)

Computer properties
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

This section describes unreleased, experimental content that is still in development which might undergo significant changes or be removed entirely.

ME Interface (Applied Energistics 2)

ME Interface methods
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.