public abstract class LockableContainerBlockEntity extends BlockEntity implements Inventory, NamedScreenHandlerFactory, Nameable
| Modifier and Type | Field and Description |
|---|---|
private Text |
customName |
private ContainerLock |
lock |
pos, removed, world| Modifier | Constructor and Description |
|---|---|
protected |
LockableContainerBlockEntity(BlockEntityType<?> type) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkUnlocked(PlayerEntity player) |
static boolean |
checkUnlocked(PlayerEntity player,
ContainerLock lock,
Text containerName) |
ScreenHandler |
createMenu(int syncId,
PlayerInventory inv,
PlayerEntity player) |
protected abstract ScreenHandler |
createScreenHandler(int syncId,
PlayerInventory playerInventory) |
void |
fromTag(BlockState state,
CompoundTag tag) |
protected abstract Text |
getContainerName() |
Text |
getCustomName() |
Text |
getDisplayName()
Returns the title of this screen handler; will be a part of the open
screen packet sent to the client.
|
Text |
getName() |
void |
setCustomName(Text customName) |
CompoundTag |
toTag(CompoundTag tag) |
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacketclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanPlayerUse, containsAny, count, getMaxCountPerStack, getStack, isEmpty, isValid, markDirty, onClose, onOpen, removeStack, removeStack, setStack, sizehasCustomNameprivate ContainerLock lock
private Text customName
protected LockableContainerBlockEntity(BlockEntityType<?> type)
public void fromTag(BlockState state, CompoundTag tag)
fromTag in class BlockEntitypublic CompoundTag toTag(CompoundTag tag)
toTag in class BlockEntitypublic void setCustomName(Text customName)
public Text getDisplayName()
getDisplayName in interface NamedScreenHandlerFactorygetDisplayName in interface Nameable@Nullable public Text getCustomName()
getCustomName in interface Nameableprotected abstract Text getContainerName()
public boolean checkUnlocked(PlayerEntity player)
public static boolean checkUnlocked(PlayerEntity player, ContainerLock lock, Text containerName)
@Nullable public ScreenHandler createMenu(int syncId, PlayerInventory inv, PlayerEntity player)
createMenu in interface ScreenHandlerFactoryprotected abstract ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory)