Class LockableContainerBlockEntity
- All Implemented Interfaces:
Inventory
,NamedScreenHandlerFactory
,ScreenHandlerFactory
,Clearable
,Nameable
- Direct Known Subclasses:
AbstractFurnaceBlockEntity
,BrewingStandBlockEntity
,LootableContainerBlockEntity
- Mappings:
Namespace Name official dng
intermediary net/minecraft/class_2624
named net/minecraft/block/entity/LockableContainerBlockEntity
-
Field Summary
FieldsFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
Fields inherited from interface net.minecraft.inventory.Inventory
DEFAULT_MAX_INTERACTION_RANGE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LockableContainerBlockEntity
(BlockEntityType<?> type, BlockPos pos, BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponents
(ComponentMap.Builder componentMapBuilder) boolean
canPlayerUse
(PlayerEntity player) Returns whetherplayer
can use this inventory.boolean
checkUnlocked
(PlayerEntity player) static boolean
checkUnlocked
(PlayerEntity player, ContainerLock lock, Text containerName) void
clear()
createMenu
(int syncId, PlayerInventory playerInventory, PlayerEntity player) protected abstract ScreenHandler
createScreenHandler
(int syncId, PlayerInventory playerInventory) protected abstract Text
Returns the custom name of this object, ornull
if there is none.Returns the title of this screen handler; will be a part of the open screen packet sent to the client.protected abstract DefaultedList
<ItemStack> getName()
Returns the name of this object.getStack
(int slot) Returns the stack currently stored atslot
.boolean
isEmpty()
Returns whether the inventory consists entirely of empty item stacks.void
readComponents
(ComponentMap components) void
readNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Reads data fromnbt
.void
removeStack
(int slot) Removes the stack currently stored atslot
.removeStack
(int slot, int amount) Removes a specific number of items fromslot
.protected abstract void
setHeldStacks
(DefaultedList<ItemStack> inventory) void
Sets the stack stored atslot
tostack
.protected void
writeNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Writes data tonbt
.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createComponentMap, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, toInitialChunkDataNbt, toUpdatePacket, writeIdToNbt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.Inventory
canTransferTo, containsAny, containsAny, count, getMaxCount, getMaxCountPerStack, isValid, markDirty, onClose, onOpen, size
Methods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
lock
- Mappings:
Namespace Name Mixin selector official d
Ldng;d:Lbpp;
intermediary field_12045
Lnet/minecraft/class_2624;field_12045:Lnet/minecraft/class_1273;
named lock
Lnet/minecraft/block/entity/LockableContainerBlockEntity;lock:Lnet/minecraft/inventory/ContainerLock;
-
customName
- Mappings:
Namespace Name Mixin selector official e
Ldng;e:Lwu;
intermediary field_17376
Lnet/minecraft/class_2624;field_17376:Lnet/minecraft/class_2561;
named customName
Lnet/minecraft/block/entity/LockableContainerBlockEntity;customName:Lnet/minecraft/text/Text;
-
-
Constructor Details
-
LockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>
Ldnm;<init>(Ldno;Lin;Ldqh;)V
intermediary <init>
Lnet/minecraft/class_2586;<init>(Lnet/minecraft/class_2591;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
named <init>
Lnet/minecraft/block/entity/BlockEntity;<init>(Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
-
Method Details
-
readNbt
Reads data fromnbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
nbt
might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.- Overrides:
readNbt
in classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Ldnm;a(Lua;Liy$a;)V
intermediary method_11014
Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
named readNbt
Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
-
writeNbt
Writes data tonbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
- Overrides:
writeNbt
in classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official b
Ldnm;b(Lua;Liy$a;)V
intermediary method_11007
Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
named writeNbt
Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
-
getName
Returns the name of this object.This should return the custom name if it exists, otherwise the default name. This should not have styling applied.
- Specified by:
getName
in interfaceNameable
- Returns:
- the name of this object
- Mappings:
Namespace Name Mixin selector official ad
Lbpr;ad()Lwu;
intermediary method_5477
Lnet/minecraft/class_1275;method_5477()Lnet/minecraft/class_2561;
named getName
Lnet/minecraft/util/Nameable;getName()Lnet/minecraft/text/Text;
-
getDisplayName
Returns the title of this screen handler; will be a part of the open screen packet sent to the client.- Specified by:
getDisplayName
in interfaceNameable
- Specified by:
getDisplayName
in interfaceNamedScreenHandlerFactory
- Returns:
- the display name of this object
- Mappings:
Namespace Name Mixin selector official O_
Lbpq;O_()Lwu;
intermediary method_5476
Lnet/minecraft/class_3908;method_5476()Lnet/minecraft/class_2561;
named getDisplayName
Lnet/minecraft/screen/NamedScreenHandlerFactory;getDisplayName()Lnet/minecraft/text/Text;
-
getCustomName
Returns the custom name of this object, ornull
if there is none.- Specified by:
getCustomName
in interfaceNameable
- Returns:
- the custom name of this object, or
null
if there is none - Mappings:
Namespace Name Mixin selector official af
Lbpr;af()Lwu;
intermediary method_5797
Lnet/minecraft/class_1275;method_5797()Lnet/minecraft/class_2561;
named getCustomName
Lnet/minecraft/util/Nameable;getCustomName()Lnet/minecraft/text/Text;
-
getContainerName
- Mappings:
Namespace Name Mixin selector official k
Ldng;k()Lwu;
intermediary method_17823
Lnet/minecraft/class_2624;method_17823()Lnet/minecraft/class_2561;
named getContainerName
Lnet/minecraft/block/entity/LockableContainerBlockEntity;getContainerName()Lnet/minecraft/text/Text;
-
checkUnlocked
- Mappings:
Namespace Name Mixin selector official d
Ldng;d(Lclh;)Z
intermediary method_17489
Lnet/minecraft/class_2624;method_17489(Lnet/minecraft/class_1657;)Z
named checkUnlocked
Lnet/minecraft/block/entity/LockableContainerBlockEntity;checkUnlocked(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
checkUnlocked
- Mappings:
Namespace Name Mixin selector official a
Ldng;a(Lclh;Lbpp;Lwu;)Z
intermediary method_17487
Lnet/minecraft/class_2624;method_17487(Lnet/minecraft/class_1657;Lnet/minecraft/class_1273;Lnet/minecraft/class_2561;)Z
named checkUnlocked
Lnet/minecraft/block/entity/LockableContainerBlockEntity;checkUnlocked(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/inventory/ContainerLock;Lnet/minecraft/text/Text;)Z
-
getHeldStacks
- Mappings:
Namespace Name Mixin selector official j
Ldng;j()Ljf;
intermediary method_11282
Lnet/minecraft/class_2624;method_11282()Lnet/minecraft/class_2371;
named getHeldStacks
Lnet/minecraft/block/entity/LockableContainerBlockEntity;getHeldStacks()Lnet/minecraft/util/collection/DefaultedList;
-
setHeldStacks
- Mappings:
Namespace Name Mixin selector official a
Ldng;a(Ljf;)V
intermediary method_11281
Lnet/minecraft/class_2624;method_11281(Lnet/minecraft/class_2371;)V
named setHeldStacks
Lnet/minecraft/block/entity/LockableContainerBlockEntity;setHeldStacks(Lnet/minecraft/util/collection/DefaultedList;)V
-
isEmpty
public boolean isEmpty()Returns whether the inventory consists entirely of empty item stacks.- Specified by:
isEmpty
in interfaceInventory
- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector official c
Lbpf;c()Z
intermediary method_5442
Lnet/minecraft/class_1263;method_5442()Z
named isEmpty
Lnet/minecraft/inventory/Inventory;isEmpty()Z
-
getStack
Returns the stack currently stored atslot
.If the slot is empty, or is outside the bounds of this inventory, this returns
ItemStack.EMPTY
.- Specified by:
getStack
in interfaceInventory
- Returns:
- the stack currently stored at
slot
- Mappings:
Namespace Name Mixin selector official a
Lbpf;a(I)Lcsz;
intermediary method_5438
Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;
named getStack
Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;
-
removeStack
Removes a specific number of items fromslot
.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector official a
Lbpf;a(II)Lcsz;
intermediary method_5434
Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;
named removeStack
Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
-
removeStack
Removes the stack currently stored atslot
.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector official b
Lbpf;b(I)Lcsz;
intermediary method_5441
Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;
named removeStack
Lnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
-
setStack
Sets the stack stored atslot
tostack
. -
canPlayerUse
Returns whetherplayer
can use this inventory.This is called by
ScreenHandler.canUse(net.minecraft.screen.ScreenHandlerContext, net.minecraft.entity.player.PlayerEntity, net.minecraft.block.Block)
.- Specified by:
canPlayerUse
in interfaceInventory
- Returns:
- whether
player
can use this inventory - See Also:
- Mappings:
Namespace Name Mixin selector official a
Lbpf;a(Lclh;)Z
intermediary method_5443
Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z
named canPlayerUse
Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
clear
public void clear() -
createMenu
@Nullable public @Nullable ScreenHandler createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player) - Specified by:
createMenu
in interfaceScreenHandlerFactory
- Mappings:
Namespace Name Mixin selector official createMenu
Lcpk;createMenu(ILclg;Lclh;)Lcod;
intermediary createMenu
Lnet/minecraft/class_1270;createMenu(ILnet/minecraft/class_1661;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1703;
named createMenu
Lnet/minecraft/screen/ScreenHandlerFactory;createMenu(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/screen/ScreenHandler;
-
createScreenHandler
- Mappings:
Namespace Name Mixin selector official a
Ldng;a(ILclg;)Lcod;
intermediary method_5465
Lnet/minecraft/class_2624;method_5465(ILnet/minecraft/class_1661;)Lnet/minecraft/class_1703;
named createScreenHandler
Lnet/minecraft/block/entity/LockableContainerBlockEntity;createScreenHandler(ILnet/minecraft/entity/player/PlayerInventory;)Lnet/minecraft/screen/ScreenHandler;
-
readComponents
- Overrides:
readComponents
in classBlockEntity
- Mappings:
Namespace Name Mixin selector official a
Ldnm;a(Ljw;)V
intermediary method_57568
Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_9323;)V
named readComponents
Lnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/component/ComponentMap;)V
-
addComponents
- Overrides:
addComponents
in classBlockEntity
- Mappings:
Namespace Name Mixin selector official a
Ldnm;a(Ljw$a;)V
intermediary method_57567
Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)V
named addComponents
Lnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)V
-
removeFromCopiedStackNbt
- Overrides:
removeFromCopiedStackNbt
in classBlockEntity
- Mappings:
Namespace Name Mixin selector official a
Ldnm;a(Lua;)V
intermediary method_57569
Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_2487;)V
named removeFromCopiedStackNbt
Lnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackNbt(Lnet/minecraft/nbt/NbtCompound;)V
-