Class DayCareDurationRegistry

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

public class DayCareDurationRegistry extends Object
Registry class for the day care durations
Since:
13/07/2022
  • Constructor Details

    • DayCareDurationRegistry

      public DayCareDurationRegistry()
  • Method Details

    • registerDuration

      public static <T extends DayCareDuration> void registerDuration(Supplier<T> t)
      Register a new supplier for a given type of DayCareDuration
      Type Parameters:
      T - The type of duration
      Parameters:
      t - The supplier of the duration
    • getDuration

      public static <T extends DayCareDuration> Optional<T> getDuration(String id)
      Attempts to get a new instance of a DayCareDuration with the given ID
      Type Parameters:
      T - The type of duration
      Parameters:
      id - The type ID
      Returns:
      The new instance
    • getAllDurations

      public static List<Supplier<DayCareDuration>> getAllDurations()
      Gets all registered suppliers
      Returns:
      All suppliers