public final class DisplayModule extends AbstractModuleWithRotation
| Modifier and Type | Class and Description |
|---|---|
static class |
DisplayModule.LeakDetector |
static class |
DisplayModule.State
Current state of the display module, decides what happens with the next
value read on any of the ports.
|
| Constructor and Description |
|---|
DisplayModule(Casing casing,
Face face) |
| Modifier and Type | Method and Description |
|---|---|
void |
finalize() |
void |
onData(io.netty.buffer.ByteBuf data)
Called with data sent from the remote instance of the module.
|
void |
onDisabled()
Called when the multi-block of casings the module is installed in is
disabled, or when the module was removed from an enabled casing.
|
void |
onDisposed()
Called when the
Casing housing the module is being disposed,
e.g. |
void |
readFromNBT(net.minecraft.nbt.NbtCompound nbt)
Restore the state of the module from the specified NBT compound.
|
void |
render(net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher rendererDispatcher,
float partialTicks,
net.minecraft.client.util.math.MatrixStack matrices,
net.minecraft.client.render.VertexConsumerProvider vcp,
int light,
int overlay)
Called to allow the module to render dynamic content on the casing it
is installed in.
|
void |
step()
Advance the state of the module.
|
void |
writeToNBT(net.minecraft.nbt.NbtCompound nbt)
Save the state of the module to the specified NBT compound.
|
getFacing, hitToUV, rotateForRendering, setFacingcancelRead, cancelWrite, getCasing, getFace, getObserverLookAt, isObserverLookingAt, isVisible, onActivate, onBeforeWriteComplete, onData, onEnabled, onInstalled, onUninstalled, onWriteCompleteclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCasing, getFace, onActivate, onBeforeWriteComplete, onData, onEnabled, onInstalled, onUninstalled, onWriteCompletepublic void step()
ModuleThis is called by the controller of the system the module is part of each tick the system is running.
step in interface Modulestep in class AbstractModulepublic void onDisabled()
ModuleModules should use this to reset their state, so that cycling power of a controller resets the whole multi-block system.
Note that this is only called on the server.
onDisabled in interface ModuleonDisabled in class AbstractModulepublic void onDisposed()
ModuleCasing housing the module is being disposed,
e.g. due to a chunk being unloaded.
This is intended for freeing up resources (e.g. allocated texture or
audio memory). Unlike Module.onDisabled() this is only called once
on a module, at the very end of its life. Avoid world interaction in
this callback to avoid loading the chunk again.
This is called on the server and the client.
onDisposed in interface ModuleonDisposed in class AbstractModule@Environment(value=CLIENT) public void finalize()
finalize in class java.lang.Objectpublic void onData(io.netty.buffer.ByteBuf data)
ModuleThis can be called on both the server and the client, depending on which side sent the message (i.e. the client can send messages to the server this way and vice versa).
onData in interface ModuleonData in class AbstractModuledata - the received data.Casing.sendData(Face, ByteBuf, byte),
Casing.sendData(Face, ByteBuf)@Environment(value=CLIENT)
public void render(net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher rendererDispatcher,
float partialTicks,
net.minecraft.client.util.math.MatrixStack matrices,
net.minecraft.client.render.VertexConsumerProvider vcp,
int light,
int overlay)
ModuleThe MatrixStack will be adjusted to take into account the face the module is installed in, i.e. rendering from (0, 0, 0) to (1, 1, 0) will render the full quad of face of the casing the module is installed in.
The light value is provided but most modules will want to ignore it
and render at max brightness using RenderUtil.maxLight.
render in interface Modulerender in class AbstractModulerendererDispatcher - the render context of the tile entity the module sits in.partialTicks - the partial time elapsed in this tick.matrices - the transformation stackvcp - the VertexConsumerProvider to query buffers fromlight - the block-local light value for rendering; usually ignored in favor of RenderUtil.maxLightoverlay - the overlay parameter for renderingpublic void readFromNBT(net.minecraft.nbt.NbtCompound nbt)
ModulereadFromNBT in interface ModulereadFromNBT in class AbstractModuleWithRotationnbt - the tag to load the state from.public void writeToNBT(net.minecraft.nbt.NbtCompound nbt)
ModulewriteToNBT in interface ModulewriteToNBT in class AbstractModuleWithRotationnbt - the tag to save the state to.