Class TileEntityGrave

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
All Implemented Interfaces:
com.ldtteam.domumornamentum.entity.block.IMateriallyTexturedBlockEntity, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.MenuProvider, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeBlockEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class TileEntityGrave extends AbstractTileEntityGrave
Tile entity for the graves.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.minecolonies.api.tileentities.AbstractTileEntityRack

    AbstractTileEntityRack.RackInventory

    Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>>
  • Field Summary

    Fields inherited from class com.minecolonies.api.tileentities.AbstractTileEntityGrave

    decay_timer, decayed, DEFAULT_DECAY_TIMER, graveData

    Fields inherited from class com.minecolonies.api.tileentities.AbstractTileEntityRack

    buildingPos, inventory, inWarehouse

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition

    Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

    INFINITE_EXTENT_AABB
  • Constructor Summary

    Constructors
    Constructor
    Description
    TileEntityGrave(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
    TileEntityGrave(net.minecraft.world.level.block.entity.BlockEntityType<? extends TileEntityGrave> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraftforge.items.ItemStackHandler
    createInventory(int slots)
    Create the inventory that belongs to the rack.
    net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int id, @NotNull net.minecraft.world.entity.player.Inventory inv, @NotNull net.minecraft.world.entity.player.Player player)
     
    Gets the content of the gave
    @NotNull net.minecraft.network.chat.Component
     
    net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
     
    @NotNull net.minecraft.nbt.CompoundTag
     
    void
    handleUpdateTag(net.minecraft.nbt.CompoundTag tag)
     
    boolean
    Checks if the chest is empty.
    void
    load(net.minecraft.nbt.CompoundTag compound)
     
    boolean
    onColonyTick(double delay)
    Update the decay of this grave onColonyTick When the timer elapses, decay the grave and reset the timer, if the grave is already decayed - remove the tile entity from the world
    void
    onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet)
     
    void
    saveAdditional(net.minecraft.nbt.CompoundTag compound)
     
    void
     
    void
    Update the blockState of the rack.
    void
    Scans through the whole storage and updates it.

    Methods inherited from class com.minecolonies.api.tileentities.AbstractTileEntityGrave

    delayDecayTimer, getGraveData, setGraveData

    Methods inherited from class com.minecolonies.api.tileentities.AbstractTileEntityRack

    getInventory, setBuildingPos, updateWarehouseIfAvailable

    Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity

    addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setLevel, triggerEvent

    Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, 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

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

    deserializeNBT, getRenderBoundingBox, hasCustomOutlineRendering, onLoad, requestModelDataUpdate, serializeNBT
  • Constructor Details

    • TileEntityGrave

      public TileEntityGrave(net.minecraft.world.level.block.entity.BlockEntityType<? extends TileEntityGrave> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
    • TileEntityGrave

      public TileEntityGrave(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • getAllContent

      public Map<ItemStorage,Integer> getAllContent()
      Gets the content of the gave
      Overrides:
      getAllContent in class TileEntityRack
      Returns:
      the map of content.
    • updateItemStorage

      public void updateItemStorage()
      Description copied from class: AbstractTileEntityRack
      Scans through the whole storage and updates it.
      Overrides:
      updateItemStorage in class TileEntityRack
    • updateBlockState

      public void updateBlockState()
      Description copied from class: AbstractTileEntityRack
      Update the blockState of the rack. Switch between connected, single, full and empty texture.
      Overrides:
      updateBlockState in class TileEntityRack
    • createInventory

      public net.minecraftforge.items.ItemStackHandler createInventory(int slots)
      Description copied from class: AbstractTileEntityRack
      Create the inventory that belongs to the rack.
      Overrides:
      createInventory in class TileEntityRack
      Parameters:
      slots - the number of slots.
      Returns:
      the created inventory,
    • isEmpty

      public boolean isEmpty()
      Description copied from class: AbstractTileEntityRack
      Checks if the chest is empty. This method checks the content list, it is therefore extremely fast.
      Overrides:
      isEmpty in class TileEntityRack
      Returns:
      true if so.
    • load

      public void load(net.minecraft.nbt.CompoundTag compound)
      Overrides:
      load in class TileEntityRack
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag compound)
      Overrides:
      saveAdditional in class TileEntityRack
    • getUpdatePacket

      public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()
      Overrides:
      getUpdatePacket in class TileEntityRack
    • getUpdateTag

      @NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag()
      Overrides:
      getUpdateTag in class TileEntityRack
    • onDataPacket

      public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet)
      Specified by:
      onDataPacket in interface net.minecraftforge.common.extensions.IForgeBlockEntity
      Overrides:
      onDataPacket in class TileEntityRack
    • handleUpdateTag

      public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag)
      Specified by:
      handleUpdateTag in interface net.minecraftforge.common.extensions.IForgeBlockEntity
      Overrides:
      handleUpdateTag in class TileEntityRack
    • setChanged

      public void setChanged()
      Overrides:
      setChanged in class TileEntityRack
    • createMenu

      @Nullable public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, @NotNull @NotNull net.minecraft.world.entity.player.Inventory inv, @NotNull @NotNull net.minecraft.world.entity.player.Player player)
      Specified by:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
      Overrides:
      createMenu in class TileEntityRack
    • getDisplayName

      @NotNull public @NotNull net.minecraft.network.chat.Component getDisplayName()
      Specified by:
      getDisplayName in interface net.minecraft.world.MenuProvider
      Overrides:
      getDisplayName in class TileEntityRack
    • onColonyTick

      public boolean onColonyTick(double delay)
      Update the decay of this grave onColonyTick When the timer elapses, decay the grave and reset the timer, if the grave is already decayed - remove the tile entity from the world
      Parameters:
      delay - number of tick between each call
      Returns:
      true if the grave still exist, false otherwise