Class BuildingAddRecipeCriterionInstance
java.lang.Object
net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance
com.minecolonies.api.advancements.building_add_recipe.BuildingAddRecipeCriterionInstance
- All Implemented Interfaces:
net.minecraft.advancements.CriterionTriggerInstance
public class BuildingAddRecipeCriterionInstance
extends net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance
The test instance to check the various conditions for "building_add_recipe"
-
Constructor Summary
ConstructorsConstructorDescriptionDefault instance when no conditions are applied to the triggerBuildingAddRecipeCriterionInstance(net.minecraft.advancements.critereon.ItemPredicate[] outputItemPredicates) Instance with the condition to check what item recipe was addedBuildingAddRecipeCriterionInstance(net.minecraft.advancements.critereon.ItemPredicate[] outputItemPredicates, int craftingSize) Instance with the condition to check what item recipe was added and at what grid size -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull BuildingAddRecipeCriterionInstancedeserializeFromJson(@NotNull com.google.gson.JsonObject jsonObject, @NotNull net.minecraft.advancements.critereon.DeserializationContext context) @NotNull com.google.gson.JsonObjectserializeToJson(@NotNull net.minecraft.advancements.critereon.SerializationContext context) booleantest(IRecipeStorage recipeStorage) Performs the check for these criteriaMethods inherited from class net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance
getCriterion, getPlayerPredicate, toString
-
Constructor Details
-
BuildingAddRecipeCriterionInstance
public BuildingAddRecipeCriterionInstance()Default instance when no conditions are applied to the trigger -
BuildingAddRecipeCriterionInstance
public BuildingAddRecipeCriterionInstance(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
-
BuildingAddRecipeCriterionInstance
public BuildingAddRecipeCriterionInstance(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
-
-
Method Details
-
test
Performs the check for these criteria- Parameters:
recipeStorage- the recipe that was just added- Returns:
- whether the check succeeded
-
deserializeFromJson
@NotNull public static @NotNull BuildingAddRecipeCriterionInstance deserializeFromJson(@NotNull @NotNull com.google.gson.JsonObject jsonObject, @NotNull @NotNull net.minecraft.advancements.critereon.DeserializationContext context) -
serializeToJson
@NotNull public @NotNull com.google.gson.JsonObject serializeToJson(@NotNull @NotNull net.minecraft.advancements.critereon.SerializationContext context) - Specified by:
serializeToJsonin interfacenet.minecraft.advancements.CriterionTriggerInstance- Overrides:
serializeToJsonin classnet.minecraft.advancements.critereon.AbstractCriterionTriggerInstance
-