Class DayCareConditionRegistry

java.lang.Object
com.pixelmonmod.pixelmon.api.daycare.DayCareConditionRegistry

public class DayCareConditionRegistry extends Object
Registry containing all the types of the DayCareRequirement interface
Since:
25/06/2022
  • Field Details

    • GSON

      public static final com.google.gson.Gson GSON
  • Constructor Details

    • DayCareConditionRegistry

      public DayCareConditionRegistry()
  • Method Details

    • setConditionSupplier

      public static void setConditionSupplier(Supplier<DayCareCondition> conditionSupplier)
      Sets the day care condition supplier
      Parameters:
      conditionSupplier - The supplier
    • getConditionSupplier

      public static Supplier<DayCareCondition> getConditionSupplier()
    • registerRequirement

      public static <T extends DayCareRequirement> void registerRequirement(Supplier<T> t)
      Register a new supplier for a given type of DayCareRequirement
      Type Parameters:
      T - The type of breeding requirement
      Parameters:
      t - The supplier of the type
    • getRequirement

      public static <T extends DayCareRequirement> Optional<T> getRequirement(String id)
      Attempts to get a new instance of a DayCareRequirement with the given ID
      Type Parameters:
      T - The type of breeding requirement
      Parameters:
      id - The type ID
      Returns:
      The new instance
    • getAllRequirements

      public static List<Supplier<DayCareRequirement>> getAllRequirements()
      Gets all registered suppliers
      Returns:
      All suppliers
    • getAllConditions

      public static List<DayCareCondition> getAllConditions()
      Gets all loaded conditions from datapack
      Returns:
      The conditions
    • reset

      public static void reset()
      Clears all registered conditions
    • readFromJson

      public static void readFromJson(com.google.gson.Gson gson, com.google.gson.JsonElement jsonElement)
      Attempts to read a JSON input as a condition
      Parameters:
      gson - The gson instance
      jsonElement - The json element