Package forestry.api.multiblock
Interface IMultiblockLogic
- All Superinterfaces:
INbtWritable
- All Known Subinterfaces:
IMultiblockLogicAlveary,IMultiblockLogicFarm
Multiblock Logic implements the basic logic for IMultiblockComponent tile entities.
Instances must come from MultiblockManager.logicFactory, most of the implementation is hidden.
IMultiblockComponent tile entities must wire up the methods in the "Updating and Synchronization" section. As a starting point, you can use MultiblockTileEntityBase.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddecodeDescriptionPacket(net.minecraft.nbt.CompoundTag packetData) Reads data for client synchronization.voidencodeDescriptionPacket(net.minecraft.nbt.CompoundTag packetData) Writes data for client synchronization.voidinvalidate(net.minecraft.world.level.Level world, IMultiblockComponent part) call on Tile.invalidate()booleanvoidonChunkUnload(net.minecraft.world.level.Level world, IMultiblockComponent part) call on Tile.onChunkUnload()voidreadFromNBT(net.minecraft.nbt.CompoundTag CompoundNBT) Read the logic's data from file.voidvalidate(net.minecraft.world.level.Level world, IMultiblockComponent part) call on Tile.validate()net.minecraft.nbt.CompoundTagwrite(net.minecraft.nbt.CompoundTag CompoundNBT) Write the logic's data to file.
-
Method Details
-
isConnected
boolean isConnected()- Returns:
- True if this block is connected to a multiblock controller. False otherwise.
-
getController
IMultiblockController getController()- Returns:
- the multiblock controller for this logic
-
validate
call on Tile.validate() -
invalidate
call on Tile.invalidate() -
onChunkUnload
call on Tile.onChunkUnload() -
encodeDescriptionPacket
void encodeDescriptionPacket(net.minecraft.nbt.CompoundTag packetData) Writes data for client synchronization. Use this in Tile.getDescriptionPacket() -
decodeDescriptionPacket
void decodeDescriptionPacket(net.minecraft.nbt.CompoundTag packetData) Reads data for client synchronization. Use this in Tile.onDataPacket() -
readFromNBT
void readFromNBT(net.minecraft.nbt.CompoundTag CompoundNBT) Read the logic's data from file. Use this in Tile.read() -
write
net.minecraft.nbt.CompoundTag write(net.minecraft.nbt.CompoundTag CompoundNBT) Write the logic's data to file. Use this in Tile.write()- Specified by:
writein interfaceINbtWritable
-