Record Class ItemDamagePredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.ItemDamagePredicate
- All Implemented Interfaces:
ItemSubPredicate,SingleComponentItemPredicate<Integer>
public record ItemDamagePredicate(MinMaxBounds.Ints durability, MinMaxBounds.Ints damage)
extends Record
implements SingleComponentItemPredicate<Integer>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.advancements.critereon.ItemSubPredicate
ItemSubPredicate.Type<T extends ItemSubPredicate> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemDamagePredicate> private final MinMaxBounds.IntsThe field for thedamagerecord component.private final MinMaxBounds.IntsThe field for thedurabilityrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionItemDamagePredicate(MinMaxBounds.Ints durability, MinMaxBounds.Ints damage) Creates an instance of aItemDamagePredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptiondamage()Returns the value of thedamagerecord component.Returns the value of thedurabilityrecord component.static ItemDamagePredicatedurability(MinMaxBounds.Ints p_335837_) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanfinal StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.advancements.critereon.SingleComponentItemPredicate
matches
-
Field Details
-
durability
The field for thedurabilityrecord component. -
damage
The field for thedamagerecord component. -
CODEC
-
-
Constructor Details
-
ItemDamagePredicate
Creates an instance of aItemDamagePredicaterecord class.- Parameters:
durability- the value for thedurabilityrecord componentdamage- the value for thedamagerecord component
-
-
Method Details
-
componentType
- Specified by:
componentTypein interfaceSingleComponentItemPredicate<Integer>
-
matches
- Specified by:
matchesin interfaceSingleComponentItemPredicate<Integer>
-
durability
-
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). -
durability
Returns the value of thedurabilityrecord component.- Returns:
- the value of the
durabilityrecord component
-
damage
Returns the value of thedamagerecord component.- Returns:
- the value of the
damagerecord component
-