public final class ModuleReadOnlyMemory extends ModuleRandomAccessMemory
ModuleRandomAccessMemory.Stateaddress, DATA_TYPE_CLEAR, memory, MEMORY_SIZE, PACKET_CLEAR, PACKET_FULL, PACKET_SINGLE, QUADS_SIZE_U, QUADS_SIZE_V, QUADS_STEP_U, QUADS_STEP_V, QUADS_U0, QUADS_V0, state, TAG_ADDRESS, TAG_MEMORY, TAG_STATE| Constructor and Description |
|---|
ModuleReadOnlyMemory(Casing casing,
Face face) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
beginRead(Pipe pipe)
Called whenever the module tries to start reading.
|
protected void |
clearOnDisabled() |
void |
onInstalled(net.minecraft.item.ItemStack stack)
Called when the module is being installed into a
Casing. |
void |
onUninstalled(net.minecraft.item.ItemStack stack)
Called after the module was uninstalled from a
Casing. |
protected void |
setCellColor(float brightness)
Set the color of the memory cell currently being drawn.
|
load, onActivate, onData, onDisabled, onWriteComplete, readFromNBT, render, step, writeToNBTgetFacing, hitToUV, rotateForRendering, setFacingcancelRead, cancelWrite, getCasing, getFace, getPlayerLookAt, isPlayerLookingAt, isVisible, onData, onDisposed, onEnabledpublic void onInstalled(net.minecraft.item.ItemStack stack)
ModuleCasing.
This is mainly for convenience and having things in one place, you could
just as well restore state in your ModuleProvider's
ModuleProvider.createModule(ItemStack, Casing, Face) method.
This is called before the first Module.onEnabled(), and also before
it is actually set in the containing Casing. Particularly
this means Casing.getModule(Face) for the module's Face
will return null in this callback.
Note that this is only called on the server.
onInstalled in interface ModuleonInstalled in class AbstractModulestack - the item stack the module was created from.public void onUninstalled(net.minecraft.item.ItemStack stack)
ModuleCasing.
This allows storing any data that should be persisted onto the module's item representation. For most modules this will not apply, since they are generally stateless / reset state when the computer shuts down.
This is called after the last Module.onDisabled() and is equivalent
to a dispose method (i.e. the module will not be used again
after this).
Note that this is only called on the server.
onUninstalled in interface ModuleonUninstalled in class AbstractModulestack - the stack representing the module.protected void clearOnDisabled()
clearOnDisabled in class ModuleRandomAccessMemoryprotected void beginRead(Pipe pipe)
ModuleRandomAccessMemorybeginRead in class ModuleRandomAccessMemorypipe - the pipe to start reading on.protected void setCellColor(float brightness)
ModuleRandomAccessMemorysetCellColor in class ModuleRandomAccessMemorybrightness - the brightness the cell is rendered at (the alpha).