Class BaseContainerBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
- All Implemented Interfaces:
Clearable
,Container
,MenuConstructor
,MenuProvider
,Nameable
,ICapabilityProvider
,ICapabilityProviderImpl<BlockEntity>
,ICapabilitySerializable<CompoundTag>
,IForgeBlockEntity
,INBTSerializable<CompoundTag>
- Direct Known Subclasses:
AbstractFurnaceBlockEntity
,BrewingStandBlockEntity
,RandomizableContainerBlockEntity
public abstract class BaseContainerBlockEntity
extends BlockEntity
implements Container, MenuProvider, Nameable
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
-
Field Summary
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from interface net.minecraft.world.Container
LARGE_MAX_STACK_SIZE
Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB
-
Constructor Summary
ModifierConstructorDescriptionprotected
BaseContainerBlockEntity
(BlockEntityType<?> p_155076_, BlockPos p_155077_, BlockState p_155078_) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static boolean
protected abstract AbstractContainerMenu
createMenu
(int p_58627_, Inventory p_58628_) createMenu
(int p_58641_, Inventory p_58642_, Player p_58643_) protected IItemHandler
<T> LazyOptional<T>
getCapability
(Capability<T> cap, Direction side) Retrieves the Optional handler for the capability requested on the specific side.protected abstract Component
getName()
void
void
load
(CompoundTag p_155080_) void
protected void
saveAdditional
(CompoundTag p_187461_) void
setCustomName
(Component p_58639_) Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getTileData, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEvent
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, 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, countItem, getContainerSize, getItem, getMaxStackSize, hasAnyOf, isEmpty, removeItem, removeItemNoUpdate, setChanged, setItem, startOpen, stillValid, stopOpen
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
Methods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
lockKey
-
name
-
itemHandler
-
-
Constructor Details
-
BaseContainerBlockEntity
protected BaseContainerBlockEntity(BlockEntityType<?> p_155076_, BlockPos p_155077_, BlockState p_155078_)
-
-
Method Details
-
load
- Overrides:
load
in classBlockEntity
-
saveAdditional
- Overrides:
saveAdditional
in classBlockEntity
-
setCustomName
-
getName
-
getDisplayName
- Specified by:
getDisplayName
in interfaceMenuProvider
- Specified by:
getDisplayName
in interfaceNameable
-
getCustomName
- Specified by:
getCustomName
in interfaceNameable
-
getDefaultName
-
canOpen
-
canUnlock
-
createMenu
@Nullable public AbstractContainerMenu createMenu(int p_58641_, Inventory p_58642_, Player p_58643_) - Specified by:
createMenu
in interfaceMenuConstructor
-
createMenu
-
createUnSidedHandler
-
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 classCapabilityProvider<BlockEntity>
- 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.
-
invalidateCaps
public void invalidateCaps()- Specified by:
invalidateCaps
in interfaceICapabilityProviderImpl<BlockEntity>
- Overrides:
invalidateCaps
in classCapabilityProvider<BlockEntity>
-
reviveCaps
public void reviveCaps()- Specified by:
reviveCaps
in interfaceICapabilityProviderImpl<BlockEntity>
- Overrides:
reviveCaps
in classCapabilityProvider<BlockEntity>
-