public final class TileEntityCasing extends net.minecraft.tileentity.TileEntity implements SidedInventoryProxy, CasingProxy
Manages modules installed in it and takes care of maintaining network state with other casings (i.e. injects virtual forwarding module in slots between two casing blocks to relay data between the casings).
Also takes care of notifying a connected controller if some state changed, so that the controller can re-scan for a multi-block.
Casings do not tick. The modules installed in them are driven by a controller (transitively) connected to their casing.
| Constructor and Description |
|---|
TileEntityCasing() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkNeighbors() |
<T> T |
getCapability(net.minecraftforge.common.capabilities.Capability<T> capability,
net.minecraft.util.EnumFacing facing) |
Casing |
getCasing() |
TileEntityController |
getController() |
net.minecraft.inventory.ISidedInventory |
getInventory() |
double |
getMaxRenderDistanceSquared() |
net.minecraft.util.math.BlockPos |
getPipeHostPosition() |
net.minecraft.world.World |
getPipeHostWorld() |
Pipe[] |
getPipes()
Get the list of all pipes managed by this computer part.
|
Pipe |
getReceivingPipe(Face face,
Port port)
Receiving pipe for the specified face and port.
|
Pipe |
getSendingPipe(Face face,
Port port)
Sending pipe for the specified face and port.
|
net.minecraft.network.play.server.SPacketUpdateTileEntity |
getUpdatePacket() |
net.minecraft.nbt.NBTTagCompound |
getUpdateTag() |
void |
handleUpdateTag(net.minecraft.nbt.NBTTagCompound nbt) |
boolean |
hasCapability(net.minecraftforge.common.capabilities.Capability<?> capability,
net.minecraft.util.EnumFacing facing) |
void |
invalidate() |
boolean |
isCasingEnabled()
Actual state tracking implementation of enabled state, used in
CasingImpl.isEnabled(). |
boolean |
isReceivingPipeLocked(Face face,
Port port)
Get the current locked state of the specified receiving pipe
on the specified face of the casing.
|
boolean |
isUsableByPlayer(net.minecraft.entity.player.EntityPlayer player) |
void |
lock(net.minecraft.item.ItemStack stack) |
void |
markRedstoneDirty()
Used to notify the case that redstone inputs may have changed, which
will in turn cause modules implementing
Redstone and/or BundledRedstone
to get notified. |
void |
notifyModulesOfBlockChange(net.minecraft.util.math.BlockPos neighborPos) |
void |
onBeforeWriteComplete(Face sendingFace,
Port sendingPort) |
void |
onChunkUnload() |
void |
onDataPacket(net.minecraft.network.NetworkManager manager,
net.minecraft.network.play.server.SPacketUpdateTileEntity packet) |
void |
onWriteComplete(Face sendingFace,
Port sendingPort) |
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound nbt) |
protected void |
readFromNBTCommon(net.minecraft.nbt.NBTTagCompound nbt) |
protected void |
readFromNBTForClient(net.minecraft.nbt.NBTTagCompound nbt) |
protected void |
readFromNBTForServer(net.minecraft.nbt.NBTTagCompound nbt) |
void |
scheduleScan() |
void |
setCasingLockedClient(boolean locked)
Used for synchronizing state between server and client, letting the
client know the new locked state of a case for overlay rendering.
|
void |
setController(TileEntityController controller) |
void |
setEnabledClient(boolean value)
Used for synchronizing state between server and client, letting the
client know of the new enabled state of this casing, for rendering.
|
void |
setInventorySlotContents(int index,
net.minecraft.item.ItemStack stack,
Port facing)
Place a module stack into the specified slot, immediately setting the
module's rotation to the specified facing if it is a
Rotatable
module. |
void |
setModule(Face face,
Module module) |
protected void |
setNeighbor(Face face,
li.cil.tis3d.common.tileentity.TileEntityComputer neighbor) |
void |
setReceivingPipeLocked(Face face,
Port port,
boolean value)
Set whether the specified receiving pipe on the specified face
of the casing is locked.
|
void |
setReceivingPipeLockedClient(Face face,
Port port,
boolean value)
Used for synchronizing state between server and client, letting the
client know of the new locked state of a port, for overlay rendering.
|
void |
setStackAndModuleClient(int slot,
net.minecraft.item.ItemStack stack,
net.minecraft.nbt.NBTTagCompound moduleData)
Used for synchronizing state between server and client, letting the
client know the new item stack installed in a slot, and, if present
initialize its module with the original server state of the module.
|
void |
unlock(net.minecraft.item.ItemStack stack) |
net.minecraft.nbt.NBTTagCompound |
writeToNBT(net.minecraft.nbt.NBTTagCompound nbtIn) |
protected void |
writeToNBTCommon(net.minecraft.nbt.NBTTagCompound nbt) |
protected void |
writeToNBTForClient(net.minecraft.nbt.NBTTagCompound nbt) |
protected void |
writeToNBTForServer(net.minecraft.nbt.NBTTagCompound nbt) |
addInfoToCrashReport, canRenderBreaking, create, deserializeNBT, getBlockMetadata, getBlockType, getDisplayName, getDistanceSq, getKey, getPos, getRenderBoundingBox, getTileData, getWorld, hasFastRenderer, hasWorld, isInvalid, markDirty, mirror, onLoad, onlyOpsCanSetNbt, receiveClientEvent, register, restrictNBTCopy, rotate, serializeNBT, setPos, setWorld, setWorldCreate, shouldRefresh, shouldRenderInPass, updateContainingBlockInfo, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanExtractItem, canInsertItem, getSlotsForFaceclear, closeInventory, decrStackSize, getDisplayName, getField, getFieldCount, getInventoryStackLimit, getName, getSizeInventory, getStackInSlot, hasCustomName, isEmpty, isItemValidForSlot, markDirty, openInventory, removeStackFromSlot, setField, setInventorySlotContentsgetCasingWorld, getModule, getPosition, getSendingPipe, isEnabled, isLocked, markDirty, sendData, sendData, sendData, sendDatapublic boolean isCasingEnabled()
CasingImpl.isEnabled().public void markRedstoneDirty()
Redstone and/or BundledRedstone
to get notified.public void setReceivingPipeLocked(Face face, Port port, boolean value)
Useful for forcing adjacent modules to not communicate when they are omnidirectional, such as the redstone module.
face - the face to set the locked state for.port - the port of the receiving pipe to set the locked state for.value - the locked state to set; true for locked, false for open (default).public boolean isReceivingPipeLocked(Face face, Port port)
face - the face to get the locked state for.port - the port of the receiving pipe to get the locked state for.true if the port is locked; false otherwise.public void setInventorySlotContents(int index,
net.minecraft.item.ItemStack stack,
Port facing)
Rotatable
module.index - the slot to place the module into.stack - the stack representing the module.facing - the rotation of the module.@Nullable public TileEntityController getController()
public void setController(@Nullable
TileEntityController controller)
public void scheduleScan()
public void lock(net.minecraft.item.ItemStack stack)
public void unlock(net.minecraft.item.ItemStack stack)
public void notifyModulesOfBlockChange(net.minecraft.util.math.BlockPos neighborPos)
protected void setNeighbor(Face face, @Nullable li.cil.tis3d.common.tileentity.TileEntityComputer neighbor)
public void onBeforeWriteComplete(Face sendingFace, Port sendingPort)
onBeforeWriteComplete in interface PipeHostpublic void onWriteComplete(Face sendingFace, Port sendingPort)
onWriteComplete in interface PipeHostpublic boolean isUsableByPlayer(net.minecraft.entity.player.EntityPlayer player)
isUsableByPlayer in interface InventoryProxyisUsableByPlayer in interface net.minecraft.inventory.IInventorypublic net.minecraft.inventory.ISidedInventory getInventory()
getInventory in interface InventoryProxygetInventory in interface SidedInventoryProxypublic Casing getCasing()
getCasing in interface CasingProxypublic void invalidate()
invalidate in class net.minecraft.tileentity.TileEntitypublic void onChunkUnload()
onChunkUnload in class net.minecraft.tileentity.TileEntitypublic boolean hasCapability(net.minecraftforge.common.capabilities.Capability<?> capability,
@Nullable
net.minecraft.util.EnumFacing facing)
hasCapability in interface net.minecraftforge.common.capabilities.ICapabilityProviderhasCapability in class net.minecraft.tileentity.TileEntity@Nullable
public <T> T getCapability(net.minecraftforge.common.capabilities.Capability<T> capability,
@Nullable
net.minecraft.util.EnumFacing facing)
getCapability in interface net.minecraftforge.common.capabilities.ICapabilityProvidergetCapability in class net.minecraft.tileentity.TileEntitypublic void onDataPacket(net.minecraft.network.NetworkManager manager,
net.minecraft.network.play.server.SPacketUpdateTileEntity packet)
public double getMaxRenderDistanceSquared()
getMaxRenderDistanceSquared in class net.minecraft.tileentity.TileEntitypublic Pipe getReceivingPipe(Face face, Port port)
getReceivingPipe in interface CasinggetReceivingPipe in interface CasingProxyface - the face to get the port for.port - the port for which to get the port.Casing.getReceivingPipe(Face, Port)protected void readFromNBTForClient(net.minecraft.nbt.NBTTagCompound nbt)
protected void writeToNBTForClient(net.minecraft.nbt.NBTTagCompound nbt)
protected void readFromNBTCommon(net.minecraft.nbt.NBTTagCompound nbt)
protected void writeToNBTCommon(net.minecraft.nbt.NBTTagCompound nbt)
public void setCasingLockedClient(boolean locked)
locked - the new locked state of the case.public void setStackAndModuleClient(int slot,
net.minecraft.item.ItemStack stack,
net.minecraft.nbt.NBTTagCompound moduleData)
slot - the slot the item stack changed in.stack - the new item stack in that slot, if any.moduleData - the original state of the module on the server, if present.public void setEnabledClient(boolean value)
value - the new enabled state of this casing.public void setReceivingPipeLockedClient(Face face, Port port, boolean value)
face - the face the port belongs to.port - the port to set the locked state of.value - the new enabled state of this casing.public Pipe[] getPipes()
public Pipe getSendingPipe(Face face, Port port)
face - the face to get the port for.port - the port for which to get the port.Casing.getSendingPipe(Face, Port)public net.minecraft.world.World getPipeHostWorld()
getPipeHostWorld in interface PipeHostpublic net.minecraft.util.math.BlockPos getPipeHostPosition()
getPipeHostPosition in interface PipeHostpublic void readFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
readFromNBT in class net.minecraft.tileentity.TileEntitypublic net.minecraft.nbt.NBTTagCompound writeToNBT(net.minecraft.nbt.NBTTagCompound nbtIn)
writeToNBT in class net.minecraft.tileentity.TileEntity@Nullable public net.minecraft.network.play.server.SPacketUpdateTileEntity getUpdatePacket()
getUpdatePacket in class net.minecraft.tileentity.TileEntitypublic void handleUpdateTag(net.minecraft.nbt.NBTTagCompound nbt)
handleUpdateTag in class net.minecraft.tileentity.TileEntitypublic net.minecraft.nbt.NBTTagCompound getUpdateTag()
getUpdateTag in class net.minecraft.tileentity.TileEntitypublic void checkNeighbors()
protected void readFromNBTForServer(net.minecraft.nbt.NBTTagCompound nbt)
protected void writeToNBTForServer(net.minecraft.nbt.NBTTagCompound nbt)