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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ItemDamagePredicate> private final MinMaxBounds.Ints
The field for thedamage
record component.private final MinMaxBounds.Ints
The field for thedurability
record component. -
Constructor Summary
ConstructorDescriptionItemDamagePredicate
(MinMaxBounds.Ints durability, MinMaxBounds.Ints damage) Creates an instance of aItemDamagePredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptiondamage()
Returns the value of thedamage
record component.Returns the value of thedurability
record component.static ItemDamagePredicate
durability
(MinMaxBounds.Ints p_334087_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.advancements.critereon.SingleComponentItemPredicate
matches
-
Field Details
-
durability
The field for thedurability
record component. -
damage
The field for thedamage
record component. -
CODEC
-
-
Constructor Details
-
ItemDamagePredicate
Creates an instance of aItemDamagePredicate
record class.- Parameters:
durability
- the value for thedurability
record componentdamage
- the value for thedamage
record component
-
-
Method Details
-
componentType
- Specified by:
componentType
in interfaceSingleComponentItemPredicate<Integer>
-
matches
- Specified by:
matches
in 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 thedurability
record component.- Returns:
- the value of the
durability
record component
-
damage
Returns the value of thedamage
record component.- Returns:
- the value of the
damage
record component
-