public abstract class TileEntity extends java.lang.Object implements ICapabilitySerializable<NBTTagCompound>
Modifier and Type | Field and Description |
---|---|
protected Block |
blockType |
static AxisAlignedBB |
INFINITE_EXTENT_AABB
Sometimes default render bounding box: infinite in scope.
|
protected BlockPos |
pos |
protected boolean |
tileEntityInvalid |
protected World |
worldObj |
Constructor and Description |
---|
TileEntity() |
Modifier and Type | Method and Description |
---|---|
void |
addInfoToCrashReport(CrashReportCategory reportCategory) |
static void |
addMapping(java.lang.Class<? extends TileEntity> cl,
java.lang.String id) |
boolean |
canRenderBreaking()
Checks if this tile entity knows how to render its 'breaking' overlay effect.
|
static TileEntity |
create(NBTTagCompound compound) |
void |
deserializeNBT(NBTTagCompound nbt) |
int |
getBlockMetadata() |
Block |
getBlockType() |
<T> T |
getCapability(Capability<T> capability,
EnumFacing facing)
Retrieves the handler for the capability requested on the specific side.
|
double |
getDistanceSq(double x,
double y,
double z) |
double |
getMaxRenderDistanceSquared() |
BlockPos |
getPos() |
AxisAlignedBB |
getRenderBoundingBox()
Return an
AxisAlignedBB that controls the visible scope of a TileEntitySpecialRenderer associated with this TileEntity
Defaults to the collision bounding box Block#getCollisionBoundingBoxFromPool(World, int, int, int) associated with the block
at this location. |
NBTTagCompound |
getTileData()
Gets a
NBTTagCompound that can be used to store custom data for this tile entity. |
SPacketUpdateTileEntity |
getUpdatePacket() |
NBTTagCompound |
getUpdateTag() |
World |
getWorld() |
void |
handleUpdateTag(NBTTagCompound tag)
Called when the chunk's TE update tag, gotten from
getUpdateTag() , is received on the client. |
boolean |
hasCapability(Capability<?> capability,
EnumFacing facing)
Determines if this object has support for the capability in question on the specific side.
|
boolean |
hasFastRenderer()
If the TileEntitySpecialRenderer associated with this TileEntity can be batched in with another renderers, and won't access the GL state.
|
boolean |
hasWorldObj() |
void |
invalidate() |
boolean |
isInvalid() |
void |
markDirty() |
void |
onChunkUnload()
Called when the chunk this TileEntity is on is Unloaded.
|
void |
onDataPacket(NetworkManager net,
SPacketUpdateTileEntity pkt)
Called when you receive a TileEntityData packet for the location this
TileEntity is currently in.
|
void |
onLoad()
Called from the Chunk when this is first added to the world.
|
boolean |
onlyOpsCanSetNbt() |
void |
readFromNBT(NBTTagCompound compound) |
boolean |
receiveClientEvent(int id,
int type) |
boolean |
restrictNBTCopy()
Determines if the player can overwrite the NBT data of this tile entity while they place it using a ItemStack.
|
NBTTagCompound |
serializeNBT() |
void |
setPos(BlockPos posIn) |
void |
setWorldObj(World worldIn) |
boolean |
shouldRefresh(World world,
BlockPos pos,
IBlockState oldState,
IBlockState newSate)
Called from Chunk.setBlockIDWithMetadata and Chunk.fillChunk, determines if this tile entity should be re-created when the ID, or Metadata changes.
|
boolean |
shouldRenderInPass(int pass) |
void |
updateContainingBlockInfo() |
void |
validate() |
NBTTagCompound |
writeToNBT(NBTTagCompound compound) |
protected World worldObj
protected BlockPos pos
protected boolean tileEntityInvalid
protected Block blockType
public static final AxisAlignedBB INFINITE_EXTENT_AABB
TileEntitySpecialRenderer
.public static void addMapping(java.lang.Class<? extends TileEntity> cl, java.lang.String id)
public World getWorld()
public void setWorldObj(World worldIn)
public boolean hasWorldObj()
public void readFromNBT(NBTTagCompound compound)
public NBTTagCompound writeToNBT(NBTTagCompound compound)
public static TileEntity create(NBTTagCompound compound)
public int getBlockMetadata()
public void markDirty()
public double getDistanceSq(double x, double y, double z)
public double getMaxRenderDistanceSquared()
public BlockPos getPos()
public Block getBlockType()
@Nullable public SPacketUpdateTileEntity getUpdatePacket()
public NBTTagCompound getUpdateTag()
public boolean isInvalid()
public void invalidate()
public void validate()
public boolean receiveClientEvent(int id, int type)
public void updateContainingBlockInfo()
public void addInfoToCrashReport(CrashReportCategory reportCategory)
public void setPos(BlockPos posIn)
public boolean onlyOpsCanSetNbt()
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
net
- The NetworkManager the packet originated frompkt
- The data packetpublic void handleUpdateTag(NBTTagCompound tag)
getUpdateTag()
, is received on the client.
Used to handle this tag in a special way. By default this simply calls readFromNBT(NBTTagCompound)
.
tag
- The NBTTagCompound
sent from getUpdateTag()
public void onChunkUnload()
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate)
world
- Current worldpos
- Tile's world positionoldState
- The old ID of the blocknewState
- The new ID of the block (May be the same)public boolean shouldRenderInPass(int pass)
public AxisAlignedBB getRenderBoundingBox()
AxisAlignedBB
that controls the visible scope of a TileEntitySpecialRenderer
associated with this TileEntity
Defaults to the collision bounding box Block#getCollisionBoundingBoxFromPool(World, int, int, int)
associated with the block
at this location.AxisAlignedBB
for the TileEntity
public boolean canRenderBreaking()
public NBTTagCompound getTileData()
NBTTagCompound
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.public boolean restrictNBTCopy()
public void onLoad()
public boolean hasFastRenderer()
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
ICapabilityProvider
hasCapability
in interface ICapabilityProvider
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'public <T> T getCapability(Capability<T> capability, EnumFacing facing)
ICapabilityProvider
getCapability
in interface ICapabilityProvider
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'public void deserializeNBT(NBTTagCompound nbt)
deserializeNBT
in interface INBTSerializable<NBTTagCompound>
public NBTTagCompound serializeNBT()
serializeNBT
in interface INBTSerializable<NBTTagCompound>