Class TileEntityGrave

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
All Implemented Interfaces:
com.ldtteam.domumornamentum.entity.block.IMateriallyTexturedBlockEntity, IItemHandlerCapProvider, net.minecraft.world.Clearable, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.MenuProvider, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.client.extensions.IMenuProviderExtension, net.neoforged.neoforge.common.extensions.IBlockEntityExtension

public class TileEntityGrave extends AbstractTileEntityGrave implements net.minecraft.world.Clearable
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.minecraft.world.level.block.entity.BlockEntity

    net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField
  • 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 class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_KEY
  • 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
    void
     
    net.neoforged.neoforge.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
    getUpdateTag(net.minecraft.core.HolderLookup.Provider provider)
     
    void
    handleUpdateTag(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider)
     
    boolean
    Checks if the chest is empty.
    void
    loadAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
     
    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, net.minecraft.core.HolderLookup.Provider provider)
     
    void
    saveAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
     
    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, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setComponents, setData, setLevel, triggerEvent

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, hasData, removeData, setData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension

    hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdate

    Methods inherited from interface com.minecolonies.api.util.IItemHandlerCapProvider

    getItemHandlerCap, getItemHandlerCap

    Methods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension

    shouldTriggerClientSideContainerClosingOnOpen
  • 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.neoforged.neoforge.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.
    • loadAdditional

      public void loadAdditional(net.minecraft.nbt.CompoundTag compound, @NotNull net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      loadAdditional in class TileEntityRack
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag compound, @NotNull net.minecraft.core.HolderLookup.Provider provider)
      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(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      getUpdateTag in class TileEntityRack
    • onDataPacket

      public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet, @NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      onDataPacket in interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
      Overrides:
      onDataPacket in class TileEntityRack
    • handleUpdateTag

      public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag, @NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      handleUpdateTag in interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
      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
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface net.minecraft.world.Clearable
      Overrides:
      clearContent in class TileEntityRack