Class ReplacementLogicRegistry
java.lang.Object
com.pixelmonmod.pixelmon.api.replacement.ReplacementLogicRegistry
Registry containing all the custom replacement logic types
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.gson.Gsonstatic final Map<String,Supplier<SpawnReplacementLogic>> -
Constructor Summary
Constructors -
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 voidregister(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
-