Record Class AdvancementTests.CustomNamePredicate
java.lang.Object
java.lang.Record
net.neoforged.neoforge.debug.entity.player.AdvancementTests.CustomNamePredicate
- All Implemented Interfaces:
ItemSubPredicate
- Enclosing class:
AdvancementTests
public static record AdvancementTests.CustomNamePredicate(int data1, int data2)
extends Record
implements ItemSubPredicate
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.advancements.critereon.ItemSubPredicate
ItemSubPredicate.Type<T extends ItemSubPredicate> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thedata1record component.private final intThe field for thedata2record component.Fields inherited from interface net.minecraft.advancements.critereon.ItemSubPredicate
CODEC -
Constructor Summary
ConstructorsConstructorDescriptionCustomNamePredicate(int data1, int data2) Creates an instance of aCustomNamePredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdata1()Returns the value of thedata1record component.intdata2()Returns the value of thedata2record component.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.
-
Field Details
-
data1
private final int data1The field for thedata1record component. -
data2
private final int data2The field for thedata2record component.
-
-
Constructor Details
-
CustomNamePredicate
public CustomNamePredicate(int data1, int data2) Creates an instance of aCustomNamePredicaterecord class.- Parameters:
data1- the value for thedata1record componentdata2- the value for thedata2record component
-
-
Method Details
-
matches
- Specified by:
matchesin interfaceItemSubPredicate
-
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 with '=='. -
data1
public int data1()Returns the value of thedata1record component.- Returns:
- the value of the
data1record component
-
data2
public int data2()Returns the value of thedata2record component.- Returns:
- the value of the
data2record component
-