Class DayCareConditionRegistry
java.lang.Object
com.pixelmonmod.pixelmon.api.daycare.DayCareConditionRegistry
Registry containing all the types of the
DayCareRequirement
interface- Since:
- 25/06/2022
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<DayCareCondition>
Gets all loaded conditions from datapackstatic List<Supplier<DayCareRequirement>>
Gets all registered suppliersstatic Supplier<DayCareCondition>
static <T extends DayCareRequirement>
Optional<T>getRequirement
(String id) Attempts to get a new instance of aDayCareRequirement
with the given IDstatic void
readFromJson
(com.google.gson.Gson gson, com.google.gson.JsonElement jsonElement) Attempts to read a JSON input as a conditionstatic <T extends DayCareRequirement>
voidregisterRequirement
(Supplier<T> t) Register a new supplier for a given type ofDayCareRequirement
static void
reset()
Clears all registered conditionsstatic void
setConditionSupplier
(Supplier<DayCareCondition> conditionSupplier) Sets the day care condition supplier
-
Field Details
-
GSON
public static final com.google.gson.Gson GSON
-
-
Constructor Details
-
DayCareConditionRegistry
public DayCareConditionRegistry()
-
-
Method Details
-
setConditionSupplier
Sets the day care condition supplier- Parameters:
conditionSupplier
- The supplier
-
getConditionSupplier
-
registerRequirement
Register a new supplier for a given type ofDayCareRequirement
- Type Parameters:
T
- The type of breeding requirement- Parameters:
t
- The supplier of the type
-
getRequirement
Attempts to get a new instance of aDayCareRequirement
with the given ID- Type Parameters:
T
- The type of breeding requirement- Parameters:
id
- The type ID- Returns:
- The new instance
-
getAllRequirements
Gets all registered suppliers- Returns:
- All suppliers
-
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 instancejsonElement
- The json element
-