Record Class RecipeCraftedTrigger.TriggerInstance
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.RecipeCraftedTrigger.TriggerInstance
- All Implemented Interfaces:
SimpleCriterionTrigger.SimpleInstance
,CriterionTriggerInstance
- Enclosing class:
- RecipeCraftedTrigger
public static record RecipeCraftedTrigger.TriggerInstance(Optional<ContextAwarePredicate> player, ResourceLocation recipeId, List<ItemPredicate> ingredients)
extends Record
implements SimpleCriterionTrigger.SimpleInstance
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RecipeCraftedTrigger.TriggerInstance>
private final List<ItemPredicate>
The field for theingredients
record component.private final Optional<ContextAwarePredicate>
The field for theplayer
record component.private final ResourceLocation
The field for therecipeId
record component. -
Constructor Summary
ConstructorDescriptionTriggerInstance
(Optional<ContextAwarePredicate> player, ResourceLocation recipeId, List<ItemPredicate> ingredients) Creates an instance of aTriggerInstance
record class. -
Method Summary
Modifier and TypeMethodDescriptioncraftedItem
(ResourceLocation p_282794_) craftedItem
(ResourceLocation p_283538_, List<ItemPredicate.Builder> p_299678_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theingredients
record component.(package private) boolean
matches
(ResourceLocation p_283528_, List<ItemStack> p_283698_) player()
Returns the value of theplayer
record component.recipeId()
Returns the value of therecipeId
record component.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.SimpleCriterionTrigger.SimpleInstance
validate
-
Field Details
-
player
The field for theplayer
record component. -
recipeId
The field for therecipeId
record component. -
ingredients
The field for theingredients
record component. -
CODEC
-
-
Constructor Details
-
TriggerInstance
public TriggerInstance(Optional<ContextAwarePredicate> player, ResourceLocation recipeId, List<ItemPredicate> ingredients) Creates an instance of aTriggerInstance
record class.- Parameters:
player
- the value for theplayer
record componentrecipeId
- the value for therecipeId
record componentingredients
- the value for theingredients
record component
-
-
Method Details
-
craftedItem
public static Criterion<RecipeCraftedTrigger.TriggerInstance> craftedItem(ResourceLocation p_283538_, List<ItemPredicate.Builder> p_299678_) -
craftedItem
public static Criterion<RecipeCraftedTrigger.TriggerInstance> craftedItem(ResourceLocation p_282794_) -
matches
-
player
Returns the value of theplayer
record component.- Specified by:
player
in interfaceSimpleCriterionTrigger.SimpleInstance
- Returns:
- the value of the
player
record component
-
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)
. -
recipeId
Returns the value of therecipeId
record component.- Returns:
- the value of the
recipeId
record component
-
ingredients
Returns the value of theingredients
record component.- Returns:
- the value of the
ingredients
record component
-