Class LockableContainerBlockEntity
- All Implemented Interfaces:
Inventory,NamedScreenHandlerFactory,ScreenHandlerFactory,Clearable,Nameable
- Direct Known Subclasses:
AbstractFurnaceBlockEntity,BrewingStandBlockEntity,LootableContainerBlockEntity
- Mappings:
Namespace Name named net/minecraft/block/entity/LockableContainerBlockEntityintermediary net/minecraft/class_2624official dqb
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.entity.BlockEntity
BlockEntity.ComponentsAccess -
Field Summary
FieldsFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, worldFields inherited from interface net.minecraft.inventory.Inventory
DEFAULT_MAX_INTERACTION_RANGE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLockableContainerBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComponents(ComponentMap.Builder componentMapBuilder) booleancanPlayerUse(PlayerEntity player) Returns whetherplayercan use this inventory.booleancheckUnlocked(PlayerEntity player) static booleancheckUnlocked(PlayerEntity player, ContainerLock lock, Text containerName) voidclear()createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player) protected abstract ScreenHandlercreateScreenHandler(int syncId, PlayerInventory playerInventory) protected abstract TextReturns the custom name of this object, ornullif 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.booleanisEmpty()Returns whether the inventory consists entirely of empty item stacks.protected voidreadComponents(BlockEntity.ComponentsAccess components) protected voidreadNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Reads data fromnbt.voidremoveStack(int slot) Removes the stack currently stored atslot.removeStack(int slot, int amount) Removes a specific number of items fromslot.protected abstract voidsetHeldStacks(DefaultedList<ItemStack> inventory) voidSets the stack stored atslottostack.protected voidwriteNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Writes data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, copyItemDataRequiresOperator, createComponentlessNbt, createComponentlessNbtWithIdentifyingData, createComponentMap, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getComponents, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessNbt, readComponents, readComponents, setCachedState, setComponents, setStackNbt, setWorld, toInitialChunkDataNbt, toUpdatePacket, tryParseCustomName, writeIdToNbtMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
canTransferTo, containsAny, containsAny, count, getMaxCount, getMaxCountPerStack, isValid, markDirty, onClose, onOpen, sizeMethods inherited from interface net.minecraft.util.Nameable
hasCustomName
-
Field Details
-
lock
- Mappings:
Namespace Name Mixin selector named lockLnet/minecraft/block/entity/LockableContainerBlockEntity;lock:Lnet/minecraft/inventory/ContainerLock;intermediary field_12045Lnet/minecraft/class_2624;field_12045:Lnet/minecraft/class_1273;official dLdqb;d:Lbqu;
-
customName
- Mappings:
Namespace Name Mixin selector named customNameLnet/minecraft/block/entity/LockableContainerBlockEntity;customName:Lnet/minecraft/text/Text;intermediary field_17376Lnet/minecraft/class_2624;field_17376:Lnet/minecraft/class_2561;official eLdqb;e:Lwz;
-
-
Constructor Details
-
LockableContainerBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/entity/BlockEntity;<init>(Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary <init>Lnet/minecraft/class_2586;<init>(Lnet/minecraft/class_2591;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Ldqh;<init>(Ldqj;Ljd;Ldtc;)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.
nbtmight 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:
readNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readNbtLnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial aLdqh;a(Lub;Ljo$a;)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:
writeNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeNbtLnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial bLdqh;b(Lub;Ljo$a;)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:
getNamein interfaceNameable- Returns:
- the name of this object
- Mappings:
Namespace Name Mixin selector named getNameLnet/minecraft/util/Nameable;getName()Lnet/minecraft/text/Text;intermediary method_5477Lnet/minecraft/class_1275;method_5477()Lnet/minecraft/class_2561;official ahLbqw;ah()Lwz;
-
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- Returns:
- the display name of this object
- Mappings:
Namespace Name Mixin selector named getDisplayNameLnet/minecraft/screen/NamedScreenHandlerFactory;getDisplayName()Lnet/minecraft/text/Text;intermediary method_5476Lnet/minecraft/class_3908;method_5476()Lnet/minecraft/class_2561;official S_Lbqv;S_()Lwz;
-
getCustomName
Returns the custom name of this object, ornullif there is none.- Specified by:
getCustomNamein interfaceNameable- Returns:
- the custom name of this object, or
nullif there is none - Mappings:
Namespace Name Mixin selector named getCustomNameLnet/minecraft/util/Nameable;getCustomName()Lnet/minecraft/text/Text;intermediary method_5797Lnet/minecraft/class_1275;method_5797()Lnet/minecraft/class_2561;official ajLbqw;aj()Lwz;
-
getContainerName
- Mappings:
Namespace Name Mixin selector named getContainerNameLnet/minecraft/block/entity/LockableContainerBlockEntity;getContainerName()Lnet/minecraft/text/Text;intermediary method_17823Lnet/minecraft/class_2624;method_17823()Lnet/minecraft/class_2561;official kLdqb;k()Lwz;
-
checkUnlocked
- Mappings:
Namespace Name Mixin selector named checkUnlockedLnet/minecraft/block/entity/LockableContainerBlockEntity;checkUnlocked(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_17489Lnet/minecraft/class_2624;method_17489(Lnet/minecraft/class_1657;)Zofficial dLdqb;d(Lcmx;)Z
-
checkUnlocked
- Mappings:
Namespace Name Mixin selector named checkUnlockedLnet/minecraft/block/entity/LockableContainerBlockEntity;checkUnlocked(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/inventory/ContainerLock;Lnet/minecraft/text/Text;)Zintermediary method_17487Lnet/minecraft/class_2624;method_17487(Lnet/minecraft/class_1657;Lnet/minecraft/class_1273;Lnet/minecraft/class_2561;)Zofficial aLdqb;a(Lcmx;Lbqu;Lwz;)Z
-
getHeldStacks
- Mappings:
Namespace Name Mixin selector named getHeldStacksLnet/minecraft/block/entity/LockableContainerBlockEntity;getHeldStacks()Lnet/minecraft/util/collection/DefaultedList;intermediary method_11282Lnet/minecraft/class_2624;method_11282()Lnet/minecraft/class_2371;official jLdqb;j()Ljv;
-
setHeldStacks
- Mappings:
Namespace Name Mixin selector named setHeldStacksLnet/minecraft/block/entity/LockableContainerBlockEntity;setHeldStacks(Lnet/minecraft/util/collection/DefaultedList;)Vintermediary method_11281Lnet/minecraft/class_2624;method_11281(Lnet/minecraft/class_2371;)Vofficial aLdqb;a(Ljv;)V
-
isEmpty
public boolean isEmpty()Returns whether the inventory consists entirely of empty item stacks.- Specified by:
isEmptyin interfaceInventory- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector named isEmptyLnet/minecraft/inventory/Inventory;isEmpty()Zintermediary method_5442Lnet/minecraft/class_1263;method_5442()Zofficial cLbqk;c()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:
getStackin interfaceInventory- Returns:
- the stack currently stored at
slot - Mappings:
Namespace Name Mixin selector named getStackLnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;intermediary method_5438Lnet/minecraft/class_1263;method_5438(I)Lnet/minecraft/class_1799;official aLbqk;a(I)Lcuq;
-
removeStack
Removes a specific number of items fromslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
- Mappings:
Namespace Name Mixin selector named removeStackLnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;intermediary method_5434Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;official aLbqk;a(II)Lcuq;
-
removeStack
Removes the stack currently stored atslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector named removeStackLnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;intermediary method_5441Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;official bLbqk;b(I)Lcuq;
-
setStack
Sets the stack stored atslottostack. -
canPlayerUse
Returns whetherplayercan use this inventory.This is called by
ScreenHandler.canUse(net.minecraft.screen.ScreenHandlerContext, net.minecraft.entity.player.PlayerEntity, net.minecraft.block.Block).- Specified by:
canPlayerUsein interfaceInventory- Returns:
- whether
playercan use this inventory - See Also:
- API Note:
- Implementations should check the distance between the inventory
holder and
player. For convenience, this interface offers two methods used by block entities to implement this check. - Mappings:
Namespace Name Mixin selector named canPlayerUseLnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_5443Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Zofficial aLbqk;a(Lcmx;)Z
-
clear
public void clear() -
createMenu
@Nullable public @Nullable ScreenHandler createMenu(int syncId, PlayerInventory playerInventory, PlayerEntity player) - Specified by:
createMenuin interfaceScreenHandlerFactory- Mappings:
Namespace Name Mixin selector named createMenuLnet/minecraft/screen/ScreenHandlerFactory;createMenu(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/screen/ScreenHandler;intermediary createMenuLnet/minecraft/class_1270;createMenu(ILnet/minecraft/class_1661;Lnet/minecraft/class_1657;)Lnet/minecraft/class_1703;official createMenuLcrb;createMenu(ILcmw;Lcmx;)Lcpu;
-
createScreenHandler
- Mappings:
Namespace Name Mixin selector named createScreenHandlerLnet/minecraft/block/entity/LockableContainerBlockEntity;createScreenHandler(ILnet/minecraft/entity/player/PlayerInventory;)Lnet/minecraft/screen/ScreenHandler;intermediary method_5465Lnet/minecraft/class_2624;method_5465(ILnet/minecraft/class_1661;)Lnet/minecraft/class_1703;official aLdqb;a(ILcmw;)Lcpu;
-
readComponents
- Overrides:
readComponentsin classBlockEntity- Mappings:
Namespace Name Mixin selector named readComponentsLnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/block/entity/BlockEntity$ComponentsAccess;)Vintermediary method_57568Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_2586$class_9473;)Vofficial aLdqh;a(Ldqh$b;)V
-
addComponents
- Overrides:
addComponentsin classBlockEntity- Mappings:
Namespace Name Mixin selector named addComponentsLnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)Vintermediary method_57567Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)Vofficial aLdqh;a(Lkm$a;)V
-
removeFromCopiedStackNbt
- Overrides:
removeFromCopiedStackNbtin classBlockEntity- Mappings:
Namespace Name Mixin selector named removeFromCopiedStackNbtLnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackNbt(Lnet/minecraft/nbt/NbtCompound;)Vintermediary method_57569Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_2487;)Vofficial aLdqh;a(Lub;)V
-