Class DayCareDurationRegistry
java.lang.Object
com.pixelmonmod.pixelmon.api.daycare.DayCareDurationRegistry
Registry class for the day care durations
- Since:
- 13/07/2022
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<Supplier<DayCareDuration>>
Gets all registered suppliersstatic <T extends DayCareDuration>
Optional<T>getDuration
(String id) Attempts to get a new instance of aDayCareDuration
with the given IDstatic <T extends DayCareDuration>
voidregisterDuration
(Supplier<T> t) Register a new supplier for a given type ofDayCareDuration
-
Constructor Details
-
DayCareDurationRegistry
public DayCareDurationRegistry()
-
-
Method Details
-
registerDuration
Register a new supplier for a given type ofDayCareDuration
- Type Parameters:
T
- The type of duration- Parameters:
t
- The supplier of the duration
-
getDuration
Attempts to get a new instance of aDayCareDuration
with the given ID- Type Parameters:
T
- The type of duration- Parameters:
id
- The type ID- Returns:
- The new instance
-
getAllDurations
Gets all registered suppliers- Returns:
- All suppliers
-