Interface IForgeTileEntity
-
- All Superinterfaces:
ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,INBTSerializable<CompoundNBT>
- All Known Implementing Classes:
AbstractFurnaceTileEntity
,BannerTileEntity
,BarrelTileEntity
,BeaconTileEntity
,BedTileEntity
,BeehiveTileEntity
,BellTileEntity
,BlastFurnaceTileEntity
,BrewingStandTileEntity
,CampfireTileEntity
,ChestTileEntity
,CommandBlockTileEntity
,ComparatorTileEntity
,ConduitTileEntity
,CustomSignsTest.CustomSignTileEntity
,DaylightDetectorTileEntity
,DispenserTileEntity
,DropperTileEntity
,EnchantingTableTileEntity
,EnderChestTileEntity
,EndGatewayTileEntity
,EndPortalTileEntity
,FullPotsAccessorDemo.DioriteFlowerPotTileEntity
,FurnaceTileEntity
,HopperTileEntity
,JigsawTileEntity
,JukeboxTileEntity
,LecternTileEntity
,LockableLootTileEntity
,LockableTileEntity
,MobSpawnerTileEntity
,PistonTileEntity
,ShulkerBoxTileEntity
,SignTileEntity
,SkullTileEntity
,SmokerTileEntity
,StructureBlockTileEntity
,TileEntity
,TileFluidHandler
,TrappedChestTileEntity
public interface IForgeTileEntity extends ICapabilitySerializable<CompoundNBT>
-
-
Field Summary
Fields Modifier and Type Field Description static AxisAlignedBB
INFINITE_EXTENT_AABB
Sometimes default render bounding box: infinite in scope.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
deserializeNBT(BlockState state, CompoundNBT nbt)
default void
deserializeNBT(CompoundNBT nbt)
default IModelData
getModelData()
Allows you to return additional model data.default AxisAlignedBB
getRenderBoundingBox()
Return anAxisAlignedBB
that controls the visible scope of aTileEntitySpecialRenderer
associated with thisTileEntity
Defaults to the collision bounding boxBlock#getCollisionBoundingBoxFromPool(World, int, int, int)
associated with the block at this location.CompoundNBT
getTileData()
Gets aNBTTagCompound
that can be used to store custom data for this tile entity.default TileEntity
getTileEntity()
default void
handleUpdateTag(BlockState state, CompoundNBT tag)
Called when the chunk's TE update tag, gotten from#getUpdateTag()
, is received on the client.default void
onChunkUnloaded()
default void
onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt)
Called when you receive a TileEntityData packet for the location this TileEntity is currently in.default void
onLoad()
Called when this is first added to the world (byWorld#addTileEntity(TileEntity)
).default void
requestModelDataUpdate()
Requests a refresh for the model data of your TE Call this every time yourgetModelData()
changesdefault CompoundNBT
serializeNBT()
-
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
-
-
-
-
Field Detail
-
INFINITE_EXTENT_AABB
static final AxisAlignedBB INFINITE_EXTENT_AABB
Sometimes default render bounding box: infinite in scope. Used to control rendering onTileEntitySpecialRenderer
.
-
-
Method Detail
-
getTileEntity
default TileEntity getTileEntity()
-
deserializeNBT
default void deserializeNBT(CompoundNBT nbt)
- Specified by:
deserializeNBT
in interfaceINBTSerializable<CompoundNBT>
-
deserializeNBT
default void deserializeNBT(BlockState state, CompoundNBT nbt)
-
serializeNBT
default CompoundNBT serializeNBT()
- Specified by:
serializeNBT
in interfaceINBTSerializable<CompoundNBT>
-
onDataPacket
default void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt)
Called when you receive a TileEntityData packet for the location this TileEntity is currently in. On the client, the NetworkManager will always be the remote server. On the server, it will be whomever is responsible for sending the packet.- Parameters:
net
- The NetworkManager the packet originated frompkt
- The data packet
-
handleUpdateTag
default void handleUpdateTag(BlockState state, CompoundNBT tag)
Called when the chunk's TE update tag, gotten from#getUpdateTag()
, is received on the client.Used to handle this tag in a special way. By default this simply calls
#readFromNBT(NBTTagCompound)
.- Parameters:
tag
- TheNBTTagCompound
sent from#getUpdateTag()
-
getTileData
CompoundNBT getTileData()
Gets aNBTTagCompound
that can be used to store custom data for this tile entity. It will be written, and read from disc, so it persists over world saves.- Returns:
- A compound tag for custom data
-
onChunkUnloaded
default void onChunkUnloaded()
-
onLoad
default void onLoad()
Called when this is first added to the world (byWorld#addTileEntity(TileEntity)
). Override instead of addingif (firstTick)
stuff in update.
-
getRenderBoundingBox
default AxisAlignedBB getRenderBoundingBox()
Return anAxisAlignedBB
that controls the visible scope of aTileEntitySpecialRenderer
associated with thisTileEntity
Defaults to the collision bounding boxBlock#getCollisionBoundingBoxFromPool(World, int, int, int)
associated with the block at this location.- Returns:
- an appropriately size
AxisAlignedBB
for theTileEntity
-
requestModelDataUpdate
default void requestModelDataUpdate()
Requests a refresh for the model data of your TE Call this every time yourgetModelData()
changes
-
getModelData
@Nonnull default IModelData getModelData()
Allows you to return additional model data. This data can be used to provide additional functionality in yourIBakedModel
You need to schedule a refresh of you model data viarequestModelDataUpdate()
if the result of this function changes. Note that this method may be called on a chunk render thread instead of the main client thread- Returns:
- Your model data
-
-