Package net.minecraft.block.entity
Class LockableContainerBlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.LockableContainerBlockEntity
- All Implemented Interfaces:
Inventory,NamedScreenHandlerFactory,ScreenHandlerFactory,Clearable,Nameable
- Direct Known Subclasses:
AbstractFurnaceBlockEntity,BrewingStandBlockEntity,LootableContainerBlockEntity
public abstract class LockableContainerBlockEntity extends BlockEntity implements Inventory, NamedScreenHandlerFactory, Nameable
-
Field Summary
Fields Modifier and Type Field Description private TextcustomNameprivate ContainerLocklockFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors Modifier Constructor Description protectedLockableContainerBlockEntity(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState) -
Method Summary
Modifier and Type Method Description booleancheckUnlocked(PlayerEntity player)static booleancheckUnlocked(PlayerEntity player, ContainerLock lock, Text containerName)ScreenHandlercreateMenu(int syncId, PlayerInventory inv, PlayerEntity player)protected abstract ScreenHandlercreateScreenHandler(int syncId, PlayerInventory playerInventory)voidfromTag(CompoundTag tag)protected abstract TextgetContainerName()TextgetCustomName()TextgetDisplayName()Returns the title of this screen handler; will be a part of the open screen packet sent to the client.TextgetName()voidsetCustomName(Text customName)CompoundTagtoTag(CompoundTag tag)Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, setCachedState, setWorld, toInitialChunkDataTag, toUpdatePacketMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
canPlayerUse, containsAny, count, getMaxCountPerStack, getStack, isEmpty, isValid, markDirty, onClose, onOpen, removeStack, removeStack, setStack, sizeMethods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
lock
-
customName
-
-
Constructor Details
-
LockableContainerBlockEntity
protected LockableContainerBlockEntity(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState)
-
-
Method Details
-
fromTag
- Overrides:
fromTagin classBlockEntity
-
toTag
- Overrides:
toTagin classBlockEntity
-
setCustomName
-
getName
-
getDisplayName
Returns the title of this screen handler; will be a part of the open screen packet sent to the client.- Specified by:
getDisplayNamein interfaceNameable- Specified by:
getDisplayNamein interfaceNamedScreenHandlerFactory
-
getCustomName
- Specified by:
getCustomNamein interfaceNameable
-
getContainerName
-
checkUnlocked
-
checkUnlocked
-
createMenu
- Specified by:
createMenuin interfaceScreenHandlerFactory
-
createScreenHandler
-