Record Class AdvancedIngredientItemSubPredicate
java.lang.Object
java.lang.Record
com.petrolpark.core.data.predicate.item.AdvancedIngredientItemSubPredicate
- All Implemented Interfaces:
net.minecraft.advancements.critereon.ItemSubPredicate
public record AdvancedIngredientItemSubPredicate(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient)
extends Record
implements net.minecraft.advancements.critereon.ItemSubPredicate
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.advancements.critereon.ItemSubPredicate
net.minecraft.advancements.critereon.ItemSubPredicate.Type<T extends net.minecraft.advancements.critereon.ItemSubPredicate> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AdvancedIngredientItemSubPredicate> -
Constructor Summary
ConstructorsConstructorDescriptionAdvancedIngredientItemSubPredicate(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient) Creates an instance of aAdvancedIngredientItemSubPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> Returns the value of theingredientrecord component.booleanmatches(net.minecraft.world.item.ItemStack stack) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
AdvancedIngredientItemSubPredicate
public AdvancedIngredientItemSubPredicate(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient) Creates an instance of aAdvancedIngredientItemSubPredicaterecord class.- Parameters:
ingredient- the value for theingredientrecord component
-
-
Method Details
-
matches
public boolean matches(@Nonnull net.minecraft.world.item.ItemStack stack) - Specified by:
matchesin interfacenet.minecraft.advancements.critereon.ItemSubPredicate
-
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). -
ingredient
Returns the value of theingredientrecord component.- Returns:
- the value of the
ingredientrecord component
-