Class TileEntityGrave
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
com.minecolonies.api.tileentities.AbstractTileEntityRack
com.minecolonies.core.tileentities.TileEntityRack
com.minecolonies.api.tileentities.AbstractTileEntityGrave
com.minecolonies.core.tileentities.TileEntityGrave
- 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.RackInventoryNested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInputNested 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, graveDataFields inherited from class com.minecolonies.api.tileentities.AbstractTileEntityRack
buildingPos, inventory, inWarehouseFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionTileEntityGrave(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 TypeMethodDescriptionvoidnet.neoforged.neoforge.items.ItemStackHandlercreateInventory(int slots) Create the inventory that belongs to the rack.net.minecraft.world.inventory.AbstractContainerMenucreateMenu(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.Componentnet.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket@NotNull net.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider provider) voidhandleUpdateTag(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) booleanisEmpty()Checks if the chest is empty.voidloadAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) booleanonColonyTick(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 worldvoidonDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet, net.minecraft.core.HolderLookup.Provider provider) voidsaveAdditional(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) voidvoidUpdate the blockState of the rack.voidScans through the whole storage and updates it.Methods inherited from class com.minecolonies.api.tileentities.AbstractTileEntityGrave
delayDecayTimer, getGraveData, setGraveDataMethods inherited from class com.minecolonies.core.tileentities.TileEntityRack
getCount, getCount, getFreeSlots, getItemCount, getItemHandlerCap, getModelData, getOtherChest, getTextureData, getUpgradeSize, hasItemStack, hasItemStack, hasItemStorage, hasSimilarStack, setInWarehouse, setRemoved, updateTextureDataWith, upgradeRackSizeMethods inherited from class com.minecolonies.api.tileentities.AbstractTileEntityRack
getInventory, setBuildingPos, updateWarehouseIfAvailableMethods 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, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdateMethods inherited from interface com.minecolonies.api.util.IItemHandlerCapProvider
getItemHandlerCap, getItemHandlerCapMethods 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
Gets the content of the gave- Overrides:
getAllContentin classTileEntityRack- Returns:
- the map of content.
-
updateItemStorage
public void updateItemStorage()Description copied from class:AbstractTileEntityRackScans through the whole storage and updates it.- Overrides:
updateItemStoragein classTileEntityRack
-
updateBlockState
public void updateBlockState()Description copied from class:AbstractTileEntityRackUpdate the blockState of the rack. Switch between connected, single, full and empty texture.- Overrides:
updateBlockStatein classTileEntityRack
-
createInventory
public net.neoforged.neoforge.items.ItemStackHandler createInventory(int slots) Description copied from class:AbstractTileEntityRackCreate the inventory that belongs to the rack.- Overrides:
createInventoryin classTileEntityRack- Parameters:
slots- the number of slots.- Returns:
- the created inventory,
-
isEmpty
public boolean isEmpty()Description copied from class:AbstractTileEntityRackChecks if the chest is empty. This method checks the content list, it is therefore extremely fast.- Overrides:
isEmptyin classTileEntityRack- Returns:
- true if so.
-
loadAdditional
public void loadAdditional(net.minecraft.nbt.CompoundTag compound, @NotNull net.minecraft.core.HolderLookup.Provider provider) - Overrides:
loadAdditionalin classTileEntityRack
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag compound, @NotNull net.minecraft.core.HolderLookup.Provider provider) - Overrides:
saveAdditionalin classTileEntityRack
-
getUpdatePacket
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Overrides:
getUpdatePacketin classTileEntityRack
-
getUpdateTag
@NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Overrides:
getUpdateTagin classTileEntityRack
-
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:
onDataPacketin interfacenet.neoforged.neoforge.common.extensions.IBlockEntityExtension- Overrides:
onDataPacketin classTileEntityRack
-
handleUpdateTag
public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag, @NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
handleUpdateTagin interfacenet.neoforged.neoforge.common.extensions.IBlockEntityExtension- Overrides:
handleUpdateTagin classTileEntityRack
-
setChanged
public void setChanged()- Overrides:
setChangedin classTileEntityRack
-
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:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor- Overrides:
createMenuin classTileEntityRack
-
getDisplayName
@NotNull public @NotNull net.minecraft.network.chat.Component getDisplayName()- Specified by:
getDisplayNamein interfacenet.minecraft.world.MenuProvider- Overrides:
getDisplayNamein classTileEntityRack
-
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:
clearContentin interfacenet.minecraft.world.Clearable- Overrides:
clearContentin classTileEntityRack
-