Package net.minecraft.inventory
Class ContainerLock
java.lang.Object
net.minecraft.inventory.ContainerLock
- Mappings:
Namespace Name official bdyintermediary net/minecraft/class_1273named net/minecraft/inventory/ContainerLock
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this lock can be opened with the key item stack.static ContainerLockfromNbt(NbtCompound nbt) Creates a newContainerLockfrom theLockkey of the NBT compound.voidwriteNbt(NbtCompound nbt) Inserts the key string of this lock into theLockkey of the NBT compound.
-
Field Details
-
EMPTY
An empty container lock that can always be opened.- Mappings:
Namespace Name Mixin selector official aLbdy;a:Lbdy;intermediary field_5817Lnet/minecraft/class_1273;field_5817:Lnet/minecraft/class_1273;named EMPTYLnet/minecraft/inventory/ContainerLock;EMPTY:Lnet/minecraft/inventory/ContainerLock;
-
LOCK_KEY
- See Also:
- Mappings:
Namespace Name Mixin selector official bLbdy;b:Ljava/lang/String;intermediary field_29956Lnet/minecraft/class_1273;field_29956:Ljava/lang/String;named LOCK_KEYLnet/minecraft/inventory/ContainerLock;LOCK_KEY:Ljava/lang/String;
-
key
- Mappings:
Namespace Name Mixin selector official cLbdy;c:Ljava/lang/String;intermediary field_5818Lnet/minecraft/class_1273;field_5818:Ljava/lang/String;named keyLnet/minecraft/inventory/ContainerLock;key:Ljava/lang/String;
-
-
Constructor Details
-
ContainerLock
- Mappings:
Namespace Name Mixin selector official <init>Lbdy;<init>(Ljava/lang/String;)Vintermediary <init>Lnet/minecraft/class_1273;<init>(Ljava/lang/String;)Vnamed <init>Lnet/minecraft/inventory/ContainerLock;<init>(Ljava/lang/String;)V
-
-
Method Details
-
canOpen
Returns true if this lock can be opened with the key item stack.An item stack is a valid key if the stack name matches the key string of this lock, or if the key string is empty.
- Parameters:
stack- the key item stack- Mappings:
Namespace Name Mixin selector official aLbdy;a(Lcfx;)Zintermediary method_5472Lnet/minecraft/class_1273;method_5472(Lnet/minecraft/class_1799;)Znamed canOpenLnet/minecraft/inventory/ContainerLock;canOpen(Lnet/minecraft/item/ItemStack;)Z
-
writeNbt
Inserts the key string of this lock into theLockkey of the NBT compound.- Mappings:
Namespace Name Mixin selector official aLbdy;a(Lqr;)Vintermediary method_5474Lnet/minecraft/class_1273;method_5474(Lnet/minecraft/class_2487;)Vnamed writeNbtLnet/minecraft/inventory/ContainerLock;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
-
fromNbt
Creates a newContainerLockfrom theLockkey of the NBT compound.If the
Lockkey is not present, returns an empty lock.- Mappings:
Namespace Name Mixin selector official bLbdy;b(Lqr;)Lbdy;intermediary method_5473Lnet/minecraft/class_1273;method_5473(Lnet/minecraft/class_2487;)Lnet/minecraft/class_1273;named fromNbtLnet/minecraft/inventory/ContainerLock;fromNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/inventory/ContainerLock;
-