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<?> blockEntityType,
BlockPos blockPos,
BlockState blockState) |
| 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(CompoundTag compoundTag) |
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) |
cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, setCachedState, setWorld, 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<?> blockEntityType, BlockPos blockPos, BlockState blockState)
public void fromTag(CompoundTag compoundTag)
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)