Package net.minecraft.tileentity
Class TileEntity
- java.lang.Object
-
- net.minecraftforge.common.capabilities.CapabilityProvider<TileEntity>
-
- net.minecraft.tileentity.TileEntity
-
- All Implemented Interfaces:
ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,IForgeTileEntity
,INBTSerializable<CompoundNBT>
- Direct Known Subclasses:
BannerTileEntity
,BeaconTileEntity
,BedTileEntity
,BeehiveTileEntity
,BellTileEntity
,CampfireTileEntity
,CommandBlockTileEntity
,ComparatorTileEntity
,ConduitTileEntity
,DaylightDetectorTileEntity
,EnchantingTableTileEntity
,EnderChestTileEntity
,EndPortalTileEntity
,FullPotsAccessorDemo.DioriteFlowerPotTileEntity
,JigsawTileEntity
,JukeboxTileEntity
,LecternTileEntity
,LockableTileEntity
,MobSpawnerTileEntity
,PistonTileEntity
,SignTileEntity
,SkullTileEntity
,StructureBlockTileEntity
,TileFluidHandler
public abstract class TileEntity extends CapabilityProvider<TileEntity> implements IForgeTileEntity
-
-
Field Summary
Fields Modifier and Type Field Description private BlockState
blockState
private CompoundNBT
customTileData
private boolean
hasLoggedInvalidStateBefore
protected World
level
private static org.apache.logging.log4j.Logger
LOGGER
protected boolean
remove
private TileEntityType<?>
type
protected BlockPos
worldPosition
-
Fields inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
INFINITE_EXTENT_AABB
-
-
Constructor Summary
Constructors Constructor Description TileEntity(TileEntityType<?> p_i48289_1_)
-
Method Summary
-
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
deserializeNBT, deserializeNBT, getModelData, getRenderBoundingBox, getTileEntity, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
-
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
type
private final TileEntityType<?> type
-
level
@Nullable protected World level
-
worldPosition
protected BlockPos worldPosition
-
remove
protected boolean remove
-
blockState
@Nullable private BlockState blockState
-
hasLoggedInvalidStateBefore
private boolean hasLoggedInvalidStateBefore
-
customTileData
private CompoundNBT customTileData
-
-
Constructor Detail
-
TileEntity
public TileEntity(TileEntityType<?> p_i48289_1_)
-
-
Method Detail
-
getLevel
@Nullable public World getLevel()
-
hasLevel
public boolean hasLevel()
-
load
public void load(BlockState p_230337_1_, CompoundNBT p_230337_2_)
-
save
public CompoundNBT save(CompoundNBT p_189515_1_)
-
saveMetadata
private CompoundNBT saveMetadata(CompoundNBT p_189516_1_)
-
loadStatic
@Nullable public static TileEntity loadStatic(BlockState p_235657_0_, CompoundNBT p_235657_1_)
-
setChanged
public void setChanged()
-
getViewDistance
public double getViewDistance()
-
getBlockPos
public BlockPos getBlockPos()
-
getBlockState
public BlockState getBlockState()
-
getUpdatePacket
@Nullable public SUpdateTileEntityPacket getUpdatePacket()
-
getUpdateTag
public CompoundNBT getUpdateTag()
-
isRemoved
public boolean isRemoved()
-
setRemoved
public void setRemoved()
-
onChunkUnloaded
public void onChunkUnloaded()
- Specified by:
onChunkUnloaded
in interfaceIForgeTileEntity
-
clearRemoved
public void clearRemoved()
-
triggerEvent
public boolean triggerEvent(int p_145842_1_, int p_145842_2_)
-
clearCache
public void clearCache()
-
fillCrashReportCategory
public void fillCrashReportCategory(CrashReportCategory p_145828_1_)
-
setPosition
public void setPosition(BlockPos p_174878_1_)
-
onlyOpCanSetNbt
public boolean onlyOpCanSetNbt()
-
rotate
public void rotate(Rotation p_189667_1_)
-
mirror
public void mirror(Mirror p_189668_1_)
-
getType
public TileEntityType<?> getType()
-
getTileData
public CompoundNBT getTileData()
Description copied from interface:IForgeTileEntity
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.- Specified by:
getTileData
in interfaceIForgeTileEntity
- Returns:
- A compound tag for custom data
-
logInvalidState
public void logInvalidState()
-
-