Class TileEntityGrave
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
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,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>
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.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, 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 interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
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 TypeMethodDescriptionnet.minecraftforge.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.CompoundTagvoidhandleUpdateTag(net.minecraft.nbt.CompoundTag tag) booleanisEmpty()Checks if the chest is empty.voidload(net.minecraft.nbt.CompoundTag compound) 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) voidsaveAdditional(net.minecraft.nbt.CompoundTag compound) 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
getCapability, getCount, getCount, getFreeSlots, getItemCount, 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, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setLevel, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods 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
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.minecraftforge.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.
-
load
public void load(net.minecraft.nbt.CompoundTag compound) - Overrides:
loadin classTileEntityRack
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag compound) - Overrides:
saveAdditionalin classTileEntityRack
-
getUpdatePacket
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Overrides:
getUpdatePacketin classTileEntityRack
-
getUpdateTag
@NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag()- Overrides:
getUpdateTagin classTileEntityRack
-
onDataPacket
public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet) - Specified by:
onDataPacketin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
onDataPacketin classTileEntityRack
-
handleUpdateTag
public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag) - Specified by:
handleUpdateTagin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- 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
-