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 aLockCoderecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToTag(ValueOutput parent) booleanfinal booleanIndicates whether some other object is "equal to" this one.static LockCodefromTag(ValueInput parent) final inthashCode()Returns a hash code value for this object.Returns the value of thepredicaterecord component.final StringtoString()Returns a string representation of this record class.booleanunlocksWith(ItemStack itemStack)
-
Field Details
-
predicate
The field for thepredicaterecord component. -
NO_LOCK
-
CODEC
-
TAG_LOCK
- See Also:
-
-
Constructor Details
-
LockCode
Creates an instance of aLockCoderecord class.- Parameters:
predicate- the value for thepredicaterecord component
-
-
Method Details
-
unlocksWith
-
addToTag
-
canUnlock
-
fromTag
-
toString
-
hashCode
-
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 thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-