Package net.minecraft.inventory
Record Class ContainerLock
java.lang.Object
java.lang.Record
net.minecraft.inventory.ContainerLock
- Record Components:
predicate
-
- Mappings:
Namespace Name named net/minecraft/inventory/ContainerLock
intermediary net/minecraft/class_1273
official btj
named predicate
intermediary comp_3222
official d
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ContainerLock> static final ContainerLock
An empty container lock that can always be opened.static final String
private final ItemPredicate
The field for thepredicate
record component. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this lock can be opened with the key item stack.final boolean
Indicates whether some other object is "equal to" this one.static ContainerLock
fromNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Creates a newContainerLock
from theLock
key of the NBT compound.final int
hashCode()
Returns a hash code value for this object.Returns the value of thepredicate
record component.final String
toString()
Returns a string representation of this record class.void
writeNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Inserts the key string of this lock into theLock
key of the NBT compound.
-
Field Details
-
predicate
The field for thepredicate
record component. -
EMPTY
An empty container lock that can always be opened.- Mappings:
Namespace Name Mixin selector named EMPTY
Lnet/minecraft/inventory/ContainerLock;EMPTY:Lnet/minecraft/inventory/ContainerLock;
intermediary field_5817
Lnet/minecraft/class_1273;field_5817:Lnet/minecraft/class_1273;
official a
Lbtj;a:Lbtj;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/inventory/ContainerLock;CODEC:Lcom/mojang/serialization/Codec;
intermediary field_49206
Lnet/minecraft/class_1273;field_49206:Lcom/mojang/serialization/Codec;
official b
Lbtj;b:Lcom/mojang/serialization/Codec;
-
LOCK_KEY
- See Also:
- Mappings:
Namespace Name Mixin selector named LOCK_KEY
Lnet/minecraft/inventory/ContainerLock;LOCK_KEY:Ljava/lang/String;
intermediary field_29956
Lnet/minecraft/class_1273;field_29956:Ljava/lang/String;
official c
Lbtj;c:Ljava/lang/String;
-
-
Constructor Details
-
ContainerLock
-
-
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.
- Mappings:
Namespace Name Mixin selector named canOpen
Lnet/minecraft/inventory/ContainerLock;canOpen(Lnet/minecraft/item/ItemStack;)Z
intermediary method_5472
Lnet/minecraft/class_1273;method_5472(Lnet/minecraft/class_1799;)Z
official a
Lbtj;a(Lcxo;)Z
-
writeNbt
Inserts the key string of this lock into theLock
key of the NBT compound.- Mappings:
Namespace Name Mixin selector named writeNbt
Lnet/minecraft/inventory/ContainerLock;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
intermediary method_5474
Lnet/minecraft/class_1273;method_5474(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
official a
Lbtj;a(Lux;Ljs$a;)V
-
fromNbt
Creates a newContainerLock
from theLock
key of the NBT compound.If the
Lock
key is not present, returns an empty lock.- Mappings:
Namespace Name Mixin selector named fromNbt
Lnet/minecraft/inventory/ContainerLock;fromNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/inventory/ContainerLock;
intermediary method_5473
Lnet/minecraft/class_1273;method_5473(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_1273;
official b
Lbtj;b(Lux;Ljs$a;)Lbtj;
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
predicate
Returns the value of thepredicate
record component.- Returns:
- the value of the
predicate
record component
-