public final class ModuleFacade extends AbstractModule implements BlockChangeAware, CasingFaceQuadOverride
| Constructor and Description |
|---|
ModuleFacade(Casing casing,
Face face) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<net.minecraft.client.renderer.block.model.BakedQuad> |
getCasingFaceQuads(net.minecraft.block.state.IBlockState state,
net.minecraft.util.EnumFacing side,
long randomSeed)
Called to obtain quads to use for the specified side instead of the casing's default ones.
|
boolean |
onActivate(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
float hitX,
float hitY,
float hitZ)
Called when a player right-clicks the module while installed in a casing.
|
void |
onData(net.minecraft.nbt.NBTTagCompound nbt)
Called with NBT data sent from the remote instance of the module.
|
void |
onNeighborBlockChange(net.minecraft.util.math.BlockPos neighborPos,
boolean isModuleNeighbor)
Called when a block adjacent to the hosting
Casing changes. |
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
Restore the state of the module from the specified NBT compound.
|
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound nbt)
Save the state of the module to the specified NBT compound.
|
cancelRead, cancelWrite, getCasing, getFace, getPlayerLookAt, hitToUV, isPlayerLookingAt, isVisible, onBeforeWriteComplete, onData, onDisabled, onDisposed, onEnabled, onInstalled, onUninstalled, onWriteComplete, render, stepclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCasing, getFace, onBeforeWriteComplete, onData, onDisabled, onDisposed, onEnabled, onInstalled, onUninstalled, onWriteComplete, render, steppublic boolean onActivate(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
float hitX,
float hitY,
float hitZ)
ModuleThe face is implicitly given by the face the module is installed in, as is the world via the casing's world.
Note that there should be some way in which a click can be ignored, e.g. by a player sneaking, otherwise the module cannot be removed from the casing by hand.
onActivate in interface ModuleonActivate in class AbstractModuleplayer - the player that clicked the module.hand - the hand the player used to activate the module.hitX - the relative x position that was clicked.hitY - the relative y position that was clicked.hitZ - the relative z position that was clicked.public void onData(net.minecraft.nbt.NBTTagCompound nbt)
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 AbstractModulenbt - the received data.Casing.sendData(Face, NBTTagCompound, byte),
Casing.sendData(Face, NBTTagCompound)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 void onNeighborBlockChange(net.minecraft.util.math.BlockPos neighborPos,
boolean isModuleNeighbor)
BlockChangeAwareCasing changes.onNeighborBlockChange in interface BlockChangeAwareneighborPos - the position of the block that changed.isModuleNeighbor - whether the block that changed is the one in front of the module, for convenience.public java.util.List<net.minecraft.client.renderer.block.model.BakedQuad> getCasingFaceQuads(@Nullable
net.minecraft.block.state.IBlockState state,
net.minecraft.util.EnumFacing side,
long randomSeed)
CasingFaceQuadOverrideIBakedModel.getQuads(IBlockState, EnumFacing, long) logic.getCasingFaceQuads in interface CasingFaceQuadOverridestate - the casing's block state.side - the side to obtain replacement quads for.randomSeed - the random seed to use for the quad generation.