public class DayCareConditionRegistry
extends java.lang.Object
DayCareRequirement
interfaceModifier and Type | Field and Description |
---|---|
static com.google.gson.Gson |
GSON |
Constructor and Description |
---|
DayCareConditionRegistry() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<DayCareCondition> |
getAllConditions()
Gets all loaded conditions from datapack
|
static java.util.List<java.util.function.Supplier<DayCareRequirement>> |
getAllRequirements()
Gets all registered suppliers
|
static java.util.function.Supplier<DayCareCondition> |
getConditionSupplier() |
static <T extends DayCareRequirement> |
getRequirement(java.lang.String id)
Attempts to get a new instance of a
DayCareRequirement with the given ID |
static void |
readFromJson(com.google.gson.Gson gson,
com.google.gson.JsonElement jsonElement)
Attempts to read a JSON input as a condition
|
static <T extends DayCareRequirement> |
registerRequirement(java.util.function.Supplier<T> t)
Register a new supplier for a given type of
DayCareRequirement |
static void |
reset()
Clears all registered conditions
|
static void |
setConditionSupplier(java.util.function.Supplier<DayCareCondition> conditionSupplier)
Sets the day care condition supplier
|
public static void setConditionSupplier(java.util.function.Supplier<DayCareCondition> conditionSupplier)
conditionSupplier
- The supplierpublic static java.util.function.Supplier<DayCareCondition> getConditionSupplier()
public static <T extends DayCareRequirement> void registerRequirement(java.util.function.Supplier<T> t)
DayCareRequirement
T
- The type of breeding requirementt
- The supplier of the typepublic static <T extends DayCareRequirement> java.util.Optional<T> getRequirement(java.lang.String id)
DayCareRequirement
with the given IDT
- The type of breeding requirementid
- The type IDpublic static java.util.List<java.util.function.Supplier<DayCareRequirement>> getAllRequirements()
public static java.util.List<DayCareCondition> getAllConditions()
public static void reset()
public static void readFromJson(com.google.gson.Gson gson, com.google.gson.JsonElement jsonElement)
gson
- The gson instancejsonElement
- The json element