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
Fields -
Constructor Summary
Constructors -
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 aDayCareRequirementwith the given IDstatic voidreadFromJson(com.google.gson.Gson gson, com.google.gson.JsonElement jsonElement, net.minecraft.core.HolderLookup.Provider registryAccess) Attempts to read a JSON input as a conditionstatic <T extends DayCareRequirement>
voidregisterRequirement(Supplier<T> t) Register a new supplier for a given type ofDayCareRequirementstatic voidreset()Clears all registered conditionsstatic voidsetConditionSupplier(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 aDayCareRequirementwith 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, net.minecraft.core.HolderLookup.Provider registryAccess) Attempts to read a JSON input as a condition- Parameters:
gson- The gson instancejsonElement- The json element
-