Package net.minecraft.world
Record Class LockCode
java.lang.Object
java.lang.Record
net.minecraft.world.LockCode
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLockCode
(ItemPredicate predicate) Creates an instance of aLockCode
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToTag
(CompoundTag p_19110_, HolderLookup.Provider p_379970_) final boolean
Indicates whether some other object is "equal to" this one.static LockCode
fromTag
(CompoundTag p_19112_, HolderLookup.Provider p_379857_) 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.boolean
unlocksWith
(ItemStack p_19108_)
-
Field Details
-
predicate
The field for thepredicate
record component. -
NO_LOCK
-
CODEC
-
TAG_LOCK
- See Also:
-
-
Constructor Details
-
LockCode
Creates an instance of aLockCode
record class.- Parameters:
predicate
- the value for thepredicate
record component
-
-
Method Details
-
unlocksWith
-
addToTag
-
fromTag
-
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
-