public abstract class AbstractModuleWithRotation extends AbstractModule implements Rotatable
Rotatable modules can face one of four directions, the default being
Port.UP. Most modules will either not need
this at all, or only use this when installed in the top or bottom faces
of casings. In some cases you may also merely want to use this for
graphical purposes (e.g. the built-in redstone and stack modules do
this).
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractModuleWithRotation(Casing casing,
Face face) |
| Modifier and Type | Method and Description |
|---|---|
Port |
getFacing()
Get the current orientation of the module.
|
protected net.minecraft.util.math.Vec3d |
hitToUV(net.minecraft.util.math.Vec3d hitPos)
Project a hit position on the surface of a casing to a UV coordinate on
the face of this module.
|
void |
readFromNBT(net.minecraft.nbt.CompoundTag nbt)
Restore the state of the module from the specified NBT compound.
|
protected void |
rotateForRendering(net.minecraft.client.util.math.MatrixStack matrices)
Apply the module's rotation to
matrices. |
void |
setFacing(Port facing)
Set the orientation of the module.
|
void |
writeToNBT(net.minecraft.nbt.CompoundTag nbt)
Save the state of the module to the specified NBT compound.
|
cancelRead, cancelWrite, getCasing, getFace, getObserverLookAt, isObserverLookingAt, isVisible, onActivate, onBeforeWriteComplete, onData, onData, onDisabled, onDisposed, onEnabled, onInstalled, onUninstalled, onWriteComplete, render, stepclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCasing, getFace, onActivate, onBeforeWriteComplete, onData, onData, onDisabled, onDisposed, onEnabled, onInstalled, onUninstalled, onWriteComplete, render, step@Environment(value=CLIENT) protected void rotateForRendering(net.minecraft.client.util.math.MatrixStack matrices)
matrices.matrices - the transformation stack to apply the rotation to.protected net.minecraft.util.math.Vec3d hitToUV(net.minecraft.util.math.Vec3d hitPos)
AbstractModule
Note that this is also overridden in AbstractModuleWithRotation to
take into account the module's rotation.
hitToUV in class AbstractModulehitPos - the hit position to project.AbstractModule.getObserverLookAt(BlockEntityRenderDispatcher),
Module.onActivate(PlayerEntity, Hand, Vec3d)public void readFromNBT(net.minecraft.nbt.CompoundTag nbt)
ModulereadFromNBT in interface ModulereadFromNBT in class AbstractModulenbt - the tag to load the state from.public void writeToNBT(net.minecraft.nbt.CompoundTag nbt)
ModulewriteToNBT in interface ModulewriteToNBT in class AbstractModulenbt - the tag to save the state to.public Port getFacing()
Rotatable