Class CreateBuildRequestCriterionInstance

java.lang.Object
net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance
com.minecolonies.api.advancements.create_build_request.CreateBuildRequestCriterionInstance
All Implemented Interfaces:
net.minecraft.advancements.CriterionTriggerInstance

public class CreateBuildRequestCriterionInstance extends net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance
The test instance to check "hut_name" or "structure_name" for the "create_build_request" trigger
  • Constructor Details

    • CreateBuildRequestCriterionInstance

      public CreateBuildRequestCriterionInstance()
    • CreateBuildRequestCriterionInstance

      public CreateBuildRequestCriterionInstance(String hutName)
      Construct the check with a single condition
      Parameters:
      hutName - the hut that has to be requested to succeed
    • CreateBuildRequestCriterionInstance

      public CreateBuildRequestCriterionInstance(String hutName, int level)
      Construct the check with a more specific condition
      Parameters:
      hutName - the hut that has to be requested to succeed
      level - the level that the request should complete
  • Method Details

    • test

      public boolean test(String structureName, int level)
      Performs the check for the conditions
      Parameters:
      structureName - the id of the structure that was just requested
      level - the level that the structure will be once completed, or 0
      Returns:
      whether the check succeeded
    • deserializeFromJson

      @NotNull public static @NotNull CreateBuildRequestCriterionInstance 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:
      serializeToJson in interface net.minecraft.advancements.CriterionTriggerInstance
      Overrides:
      serializeToJson in class net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance