public final class ReadOnlyMemoryModule extends RandomAccessMemoryModule
RandomAccessMemoryModule.Stateaddress, memory, MEMORY_SIZE, state| Constructor and Description |
|---|
ReadOnlyMemoryModule(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() |
protected int |
getCellColor()
Get the color of the memory cell.
|
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. |
load, onActivate, onBeforeWriteComplete, onData, onDisabled, onWriteComplete, readFromNBT, render, step, writeToNBTgetFacing, hitToUV, rotateForRendering, setFacingcancelRead, cancelWrite, getCasing, getFace, getObserverLookAt, isObserverLookingAt, 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 RandomAccessMemoryModuleprotected void beginRead(Pipe pipe)
RandomAccessMemoryModulebeginRead in class RandomAccessMemoryModulepipe - the pipe to start reading on.@Environment(value=CLIENT) protected int getCellColor()
RandomAccessMemoryModulegetCellColor in class RandomAccessMemoryModule