Class 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 Details

    • 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 Details

  • Method Details

    • getLevel

      @Nullable public World getLevel()
    • setLevelAndPosition

      public void setLevelAndPosition(World p_226984_1_, BlockPos p_226984_2_)
    • 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 interface IForgeTileEntity
    • 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 a 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.
      Specified by:
      getTileData in interface IForgeTileEntity
      Returns:
      A compound tag for custom data
    • logInvalidState

      public void logInvalidState()