public abstract class AbstractModuleRotatable 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 |
AbstractModuleRotatable(Casing casing,
Face face) |
| Modifier and Type | Method and Description |
|---|---|
Port |
getFacing()
Get the current orientation of the module.
|
protected net.minecraft.util.Vec3 |
hitToUV(net.minecraft.util.Vec3 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.NBTTagCompound nbt)
Restore the state of the module from the specified NBT compound.
|
protected void |
rotateForRendering()
Apply the module's rotation to the OpenGL state.
|
void |
setFacing(Port facing)
Set the orientation of the module.
|
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound nbt)
Save the state of the module to the specified NBT compound.
|
cancelRead, cancelWrite, getCasing, getFace, getPlayerLookAt, isPlayerLookingAt, isVisible, onActivate, onData, onData, onDisabled, onDisposed, onEnabled, onInstalled, onUninstalled, onWriteComplete, render, stepclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCasing, getFace, onActivate, onData, onData, onDisabled, onDisposed, onEnabled, onInstalled, onUninstalled, onWriteComplete, render, stepprotected void rotateForRendering()
protected net.minecraft.util.Vec3 hitToUV(net.minecraft.util.Vec3 hitPos)
AbstractModule
Note that this is also overridden in AbstractModuleRotatable to
take into account the module's rotation.
hitToUV in class AbstractModulehitPos - the hit position to project.AbstractModule.getPlayerLookAt(),
AbstractModule.onActivate(EntityPlayer, float, float, float)public void readFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
ModulereadFromNBT in interface ModulereadFromNBT in class AbstractModulenbt - the tag to load the state from.public void writeToNBT(net.minecraft.nbt.NBTTagCompound nbt)
ModulewriteToNBT in interface ModulewriteToNBT in class AbstractModulenbt - the tag to save the state to.public Port getFacing()
Rotatable