Class ChestBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
net.minecraft.world.level.block.entity.ChestBlockEntity
- All Implemented Interfaces:
Clearable
,Container
,MenuConstructor
,LidBlockEntity
,MenuProvider
,Nameable
,RandomizableContainer
,ICapabilityProvider
,ICapabilityProviderImpl<BlockEntity>
,IForgeBlockEntity
- Direct Known Subclasses:
TrappedChestBlockEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.ComponentHelper, BlockEntity.DataComponentInput
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
-
Field Summary
Modifier and TypeFieldDescriptionprivate LazyOptional
<IItemHandlerModifiable> private final ChestLidController
private static final int
private NonNullList
<ItemStack> private final ContainerOpenersCounter
Fields inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
lootTable, lootTableSeed
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER
Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB
Fields inherited from interface net.minecraft.world.RandomizableContainer
LOOT_TABLE_SEED_TAG, LOOT_TABLE_TAG
-
Constructor Summary
ModifierConstructorDescriptionChestBlockEntity
(BlockPos p_155331_, BlockState p_155332_) protected
ChestBlockEntity
(BlockEntityType<?> p_155327_, BlockPos p_155328_, BlockState p_155329_) -
Method Summary
Modifier and TypeMethodDescriptionprivate IItemHandlerModifiable
protected AbstractContainerMenu
createMenu
(int p_59082_, Inventory p_59083_) <T> LazyOptional
<T> getCapability
(Capability<T> cap, Direction side) Retrieves the Optional handler for the capability requested on the specific side.int
protected Component
protected NonNullList
<ItemStack> getItems()
static int
getOpenCount
(BlockGetter p_59087_, BlockPos p_59088_) float
getOpenNess
(float p_59080_) void
static void
lidAnimateTick
(Level p_155344_, BlockPos p_155345_, BlockState p_155346_, ChestBlockEntity p_155347_) protected void
loadAdditional
(CompoundTag p_331054_, HolderLookup.Provider p_334909_) (package private) static void
playSound
(Level p_155339_, BlockPos p_155340_, BlockState p_155341_, SoundEvent p_155342_) void
protected void
saveAdditional
(CompoundTag p_187489_, HolderLookup.Provider p_328166_) void
setBlockState
(BlockState p_155251_) protected void
setItems
(NonNullList<ItemStack> p_59110_) protected void
signalOpenCount
(Level p_155333_, BlockPos p_155334_, BlockState p_155335_, int p_155336_, int p_155337_) void
void
static void
swapContents
(ChestBlockEntity p_59104_, ChestBlockEntity p_59105_) boolean
triggerEvent
(int p_59114_, int p_59115_) Methods inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
applyImplicitComponents, canOpen, collectImplicitComponents, createMenu, getItem, getLootTable, getLootTableSeed, isEmpty, removeComponentsFromTag, removeItem, removeItemNoUpdate, setItem, setLootTable, setLootTableSeed
Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
canUnlock, clearContent, createUnSidedHandler, getCustomName, getDisplayName, getName, reviveCaps, stillValid
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadCustomOnly, loadStatic, loadWithComponents, onChunkUnloaded, onlyOpCanSetNbt, parseCustomNameSafe, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setChanged, setChanged, setComponents, setLevel, setRemoved
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCaps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.Clearable
clearContent
Methods inherited from interface net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, stillValid
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate
Methods inherited from interface net.minecraft.world.Nameable
hasCustomName
Methods inherited from interface net.minecraft.world.RandomizableContainer
getBlockPos, getLevel, setLootTable, tryLoadLootTable, trySaveLootTable, unpackLootTable
-
Field Details
-
EVENT_SET_OPEN_COUNT
private static final int EVENT_SET_OPEN_COUNT- See Also:
-
items
-
openersCounter
-
chestLidController
-
chestHandler
-
-
Constructor Details
-
ChestBlockEntity
-
ChestBlockEntity
-
-
Method Details
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceContainer
-
getDefaultName
- Specified by:
getDefaultName
in classBaseContainerBlockEntity
-
loadAdditional
- Overrides:
loadAdditional
in classBaseContainerBlockEntity
-
saveAdditional
- Overrides:
saveAdditional
in classBaseContainerBlockEntity
-
lidAnimateTick
public static void lidAnimateTick(Level p_155344_, BlockPos p_155345_, BlockState p_155346_, ChestBlockEntity p_155347_) -
playSound
static void playSound(Level p_155339_, BlockPos p_155340_, BlockState p_155341_, SoundEvent p_155342_) -
triggerEvent
public boolean triggerEvent(int p_59114_, int p_59115_) - Overrides:
triggerEvent
in classBlockEntity
-
startOpen
-
stopOpen
-
getItems
- Specified by:
getItems
in classBaseContainerBlockEntity
-
setItems
- Specified by:
setItems
in classBaseContainerBlockEntity
-
getOpenNess
public float getOpenNess(float p_59080_) - Specified by:
getOpenNess
in interfaceLidBlockEntity
-
getOpenCount
-
swapContents
-
createMenu
- Specified by:
createMenu
in classBaseContainerBlockEntity
-
recheckOpen
public void recheckOpen() -
signalOpenCount
protected void signalOpenCount(Level p_155333_, BlockPos p_155334_, BlockState p_155335_, int p_155336_, int p_155337_) -
setBlockState
- Overrides:
setBlockState
in classBlockEntity
-
getCapability
Description copied from interface:ICapabilityProvider
Retrieves the Optional handler for the capability requested on the specific side. The return value CAN be the same for multiple faces. Modders are encouraged to cache this value, using the listener capabilities of the Optional to be notified if the requested capability get lost.- Specified by:
getCapability
in interfaceICapabilityProvider
- Overrides:
getCapability
in classBaseContainerBlockEntity
- Parameters:
cap
- The capability to checkside
- The Side to check from, CAN BE NULL. Null is defined to represent 'internal' or 'self'- Returns:
- The requested an optional holding the requested capability.
-
createHandler
-
invalidateCaps
public void invalidateCaps()- Specified by:
invalidateCaps
in interfaceICapabilityProviderImpl<BlockEntity>
- Overrides:
invalidateCaps
in classBaseContainerBlockEntity
-