public abstract class MultiblockLogic<T extends IMultiblockControllerInternal> extends java.lang.Object implements IMultiblockLogic
| Modifier and Type | Field and Description |
|---|---|
protected T |
controller |
| Modifier | Constructor and Description |
|---|---|
protected |
MultiblockLogic(java.lang.Class<T> controllerClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
assertDetached(IMultiblockComponent part) |
void |
becomeMultiblockSaveDelegate() |
abstract T |
createNewController(net.minecraft.world.World world) |
void |
decodeDescriptionPacket(net.minecraft.nbt.NBTTagCompound packetData)
Override this to easily read in data from a TileEntity's description packet.
|
protected void |
detachSelf(net.minecraft.world.World world,
IMultiblockComponent part,
boolean chunkUnloading) |
void |
encodeDescriptionPacket(net.minecraft.nbt.NBTTagCompound packetData)
Override this to easily modify the description packet's data without having
to worry about sending the packet itself.
|
void |
forfeitMultiblockSaveDelegate() |
abstract T |
getController() |
java.lang.Class<T> |
getControllerClass() |
net.minecraft.nbt.NBTTagCompound |
getMultiblockSaveData() |
boolean |
hasMultiblockSaveData() |
void |
invalidate(net.minecraft.world.World world,
IMultiblockComponent part)
Called when a block is removed by game actions, such as a player breaking the block
or the block being changed into another block.
|
boolean |
isConnected() |
boolean |
isMultiblockSaveDelegate() |
boolean |
isVisited() |
void |
onChunkUnload(net.minecraft.world.World world,
IMultiblockComponent part)
Called from Minecraft's tile entity loop, after all tile entities have been ticked,
as the chunk in which this tile entity is contained is unloading.
|
void |
onMultiblockDataAssimilated() |
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound data)
Read the logic's data from file.
|
void |
setController(IMultiblockControllerInternal controller) |
void |
setUnvisited() |
void |
setVisited() |
void |
validate(net.minecraft.world.World world,
IMultiblockComponent part)
This is called when a block is being marked as valid by the chunk, but has not yet fully
been placed into the world's TileEntity cache.
|
net.minecraft.nbt.NBTTagCompound |
writeToNBT(net.minecraft.nbt.NBTTagCompound data)
Write the logic's data to file.
|
@Nullable protected T extends IMultiblockControllerInternal controller
protected MultiblockLogic(java.lang.Class<T> controllerClass)
public void setController(@Nullable
IMultiblockControllerInternal controller)
public java.lang.Class<T> getControllerClass()
public abstract T getController()
getController in interface IMultiblockLogicpublic abstract T createNewController(net.minecraft.world.World world)
public void validate(net.minecraft.world.World world,
IMultiblockComponent part)
TL;DR: Here there be dragons.
validate in interface IMultiblockLogicTileEntity.validate()public final void invalidate(net.minecraft.world.World world,
IMultiblockComponent part)
invalidate in interface IMultiblockLogicTileEntity.invalidate()public final void onChunkUnload(net.minecraft.world.World world,
IMultiblockComponent part)
onChunkUnload in interface IMultiblockLogicTileEntity.onChunkUnload()protected void detachSelf(net.minecraft.world.World world,
IMultiblockComponent part,
boolean chunkUnloading)
public void readFromNBT(net.minecraft.nbt.NBTTagCompound data)
IMultiblockLogicreadFromNBT in interface IMultiblockLogicpublic net.minecraft.nbt.NBTTagCompound writeToNBT(net.minecraft.nbt.NBTTagCompound data)
IMultiblockLogicwriteToNBT in interface INbtWritablewriteToNBT in interface IMultiblockLogicpublic final void assertDetached(IMultiblockComponent part)
public final boolean isConnected()
isConnected in interface IMultiblockLogicpublic void becomeMultiblockSaveDelegate()
public void forfeitMultiblockSaveDelegate()
public final boolean isMultiblockSaveDelegate()
public final void setUnvisited()
public final void setVisited()
public final boolean isVisited()
public final boolean hasMultiblockSaveData()
@Nullable public final net.minecraft.nbt.NBTTagCompound getMultiblockSaveData()
public final void onMultiblockDataAssimilated()
public void encodeDescriptionPacket(net.minecraft.nbt.NBTTagCompound packetData)
encodeDescriptionPacket in interface IMultiblockLogicpacketData - An NBT compound tag into which you should write your custom description data.public void decodeDescriptionPacket(net.minecraft.nbt.NBTTagCompound packetData)
decodeDescriptionPacket in interface IMultiblockLogicpacketData - The NBT data from the tile entity's description packet.