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>,IForgeBlockEntity
- 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.minecraft.world.level.block.entity.BlockEntity
BlockEntity.ComponentHelper, BlockEntity.DataComponentInputNested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>> -
Field Summary
FieldsFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFERFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseContainerBlockEntity(BlockEntityType<?> p_155076_, BlockPos p_155077_, BlockState p_155078_) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanstatic booleanvoidprotected voidprotected abstract AbstractContainerMenucreateMenu(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 ComponentgetItem(int p_334660_) protected abstract NonNullList<ItemStack> getItems()getName()voidbooleanisEmpty()protected voidloadAdditional(CompoundTag p_335335_, HolderLookup.Provider p_329555_) voidremoveComponentsFromTag(CompoundTag p_329140_) removeItem(int p_333934_, int p_332088_) removeItemNoUpdate(int p_329940_) voidprotected voidsaveAdditional(CompoundTag p_187461_, HolderLookup.Provider p_335192_) voidprotected abstract voidsetItems(NonNullList<ItemStack> p_330472_) booleanstillValid(Player p_330935_) 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, setBlockState, setChanged, setChanged, setComponents, setLevel, setRemoved, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getContainerSize, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, startOpen, stopOpenMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdateMethods 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
-
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
getName
-
getDisplayName
- Specified by:
getDisplayNamein interfaceMenuProvider- Specified by:
getDisplayNamein interfaceNameable
-
getCustomName
- Specified by:
getCustomNamein interfaceNameable
-
getDefaultName
-
canOpen
-
canUnlock
-
getItems
-
setItems
-
isEmpty
public boolean isEmpty() -
getItem
-
removeItem
- Specified by:
removeItemin interfaceContainer
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdatein interfaceContainer
-
setItem
-
stillValid
- Specified by:
stillValidin interfaceContainer
-
clearContent
public void clearContent()- Specified by:
clearContentin interfaceClearable
-
createMenu
@Nullable public AbstractContainerMenu createMenu(int p_58641_, Inventory p_58642_, Player p_58643_) - Specified by:
createMenuin interfaceMenuConstructor
-
createMenu
-
applyImplicitComponents
- Overrides:
applyImplicitComponentsin classBlockEntity
-
collectImplicitComponents
- Overrides:
collectImplicitComponentsin classBlockEntity
-
removeComponentsFromTag
- Overrides:
removeComponentsFromTagin classBlockEntity
-
createUnSidedHandler
-
getCapability
Description copied from interface:ICapabilityProviderRetrieves 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:
getCapabilityin interfaceICapabilityProvider- Overrides:
getCapabilityin 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:
invalidateCapsin interfaceICapabilityProviderImpl<BlockEntity>- Overrides:
invalidateCapsin classCapabilityProvider<BlockEntity>
-
reviveCaps
public void reviveCaps()- Specified by:
reviveCapsin interfaceICapabilityProviderImpl<BlockEntity>- Overrides:
reviveCapsin classCapabilityProvider<BlockEntity>
-