Class ColonyPopulationCriterionInstance

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

public class ColonyPopulationCriterionInstance extends net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance
The test instance to check the "population_count" for the "colony_population" trigger
  • Constructor Summary

    Constructors
    Constructor
    Description
    ColonyPopulationCriterionInstance(int populationCount)
    Constructs a check with a single condition
  • Method Summary

    Modifier and Type
    Method
    Description
    deserializeFromJson(@NotNull com.google.gson.JsonObject jsonObject, @NotNull net.minecraft.advancements.critereon.DeserializationContext context)
     
    @NotNull com.google.gson.JsonObject
    serializeToJson(@NotNull net.minecraft.advancements.critereon.SerializationContext context)
     
    boolean
    test(int populationCount)
    Performs the check for the conditions

    Methods inherited from class net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance

    getCriterion, getPlayerPredicate, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ColonyPopulationCriterionInstance

      public ColonyPopulationCriterionInstance(int populationCount)
      Constructs a check with a single condition
      Parameters:
      populationCount - the population that has to be reached to succeed
  • Method Details

    • test

      public boolean test(int populationCount)
      Performs the check for the conditions
      Parameters:
      populationCount - the current population
      Returns:
      whether the check succeeded
    • deserializeFromJson

      @NotNull public static @NotNull ColonyPopulationCriterionInstance 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