Record Class BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance
java.lang.Object
java.lang.Record
com.minecolonies.api.advancements.BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance
- All Implemented Interfaces:
net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance,net.minecraft.advancements.CriterionTriggerInstance
- Enclosing class:
BuildingAddRecipeTrigger
public static record BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, List<net.minecraft.advancements.critereon.ItemPredicate> outputItemPredicates, int craftingSize)
extends Record
implements net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance> static final intstatic final List<net.minecraft.advancements.critereon.ItemPredicate> -
Constructor Summary
ConstructorsConstructorDescriptionBuildingAddRecipeTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, List<net.minecraft.advancements.critereon.ItemPredicate> outputItemPredicates, int craftingSize) Creates an instance of aBuildingAddRecipeTriggerInstancerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.advancements.Criterion<BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance> Default instance when no conditions are applied to the triggerstatic net.minecraft.advancements.Criterion<BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance> buildingAddRecipe(List<net.minecraft.advancements.critereon.ItemPredicate> outputItemPredicates) Instance with the condition to check what item recipe was addedstatic net.minecraft.advancements.Criterion<BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance> buildingAddRecipe(List<net.minecraft.advancements.critereon.ItemPredicate> outputItemPredicates, int craftingSize) Instance with the condition to check what item recipe was added and at what grid sizeintReturns the value of thecraftingSizerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.List<net.minecraft.advancements.critereon.ItemPredicate> Returns the value of theoutputItemPredicatesrecord component.Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player()Returns the value of theplayerrecord component.booleantest(IRecipeStorage recipeStorage) Performs the check for these criteriafinal 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.SimpleCriterionTrigger.SimpleInstance
validate
-
Field Details
-
DEFAULT_CRAFTING_SIZE
public static final int DEFAULT_CRAFTING_SIZE- See Also:
-
DEFAULT_OUTPUT_ITEM_PREDICATES
public static final List<net.minecraft.advancements.critereon.ItemPredicate> DEFAULT_OUTPUT_ITEM_PREDICATES -
CODEC
public static final com.mojang.serialization.Codec<BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance> CODEC
-
-
Constructor Details
-
BuildingAddRecipeTriggerInstance
public BuildingAddRecipeTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, List<net.minecraft.advancements.critereon.ItemPredicate> outputItemPredicates, int craftingSize) Creates an instance of aBuildingAddRecipeTriggerInstancerecord class.- Parameters:
player- the value for theplayerrecord componentoutputItemPredicates- the value for theoutputItemPredicatesrecord componentcraftingSize- the value for thecraftingSizerecord component
-
-
Method Details
-
buildingAddRecipe
public static net.minecraft.advancements.Criterion<BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance> buildingAddRecipe()Default instance when no conditions are applied to the trigger -
buildingAddRecipe
public static net.minecraft.advancements.Criterion<BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance> buildingAddRecipe(List<net.minecraft.advancements.critereon.ItemPredicate> outputItemPredicates) Instance with the condition to check what item recipe was added- Parameters:
outputItemPredicates- the item recipe tester constructed from the advancement information
-
buildingAddRecipe
public static net.minecraft.advancements.Criterion<BuildingAddRecipeTrigger.BuildingAddRecipeTriggerInstance> buildingAddRecipe(List<net.minecraft.advancements.critereon.ItemPredicate> outputItemPredicates, int craftingSize) Instance with the condition to check what item recipe was added and at what grid size- Parameters:
outputItemPredicates- the item recipe tester constructed from the advancement informationcraftingSize- the NxN size of the crafting grid
-
test
Performs the check for these criteria- Parameters:
recipeStorage- the recipe that was just added- Returns:
- whether the check succeeded
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
player
Returns the value of theplayerrecord component.- Specified by:
playerin interfacenet.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance- Returns:
- the value of the
playerrecord component
-
outputItemPredicates
Returns the value of theoutputItemPredicatesrecord component.- Returns:
- the value of the
outputItemPredicatesrecord component
-
craftingSize
public int craftingSize()Returns the value of thecraftingSizerecord component.- Returns:
- the value of the
craftingSizerecord component
-