Class ReplacementLogicRegistry
java.lang.Object
com.pixelmonmod.pixelmon.api.replacement.ReplacementLogicRegistry
Registry containing all the custom replacement logic types
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.google.gson.Gson
static final Map<String,
Supplier<SpawnReplacementLogic>> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends SpawnReplacementLogic>
Optional<T>Gets a registered type with the given ID Will return an empty optional if it cannot be foundstatic void
register
(Supplier<? extends SpawnReplacementLogic> replacementLogic) Registers a new logic type
-
Field Details
-
GSON
public static final com.google.gson.Gson GSON -
SPAWN_REPLACEMENT_LOGIC
-
-
Constructor Details
-
ReplacementLogicRegistry
public ReplacementLogicRegistry()
-
-
Method Details
-
get
Gets a registered type with the given ID Will return an empty optional if it cannot be found- Type Parameters:
T
- The class type- Parameters:
type
- The type- Returns:
- An optional containing a new instance of the given type
-
register
Registers a new logic type- Parameters:
replacementLogic
- A supplier for the logic type
-