Class WorldGeneratorInjector
java.lang.Object
com.seibel.distanthorizons.coreapi.DependencyInjection.WorldGeneratorInjector
This class takes care of dependency injection for world generators.
This is done so other mods can override our world generator(s) to improve or replace them.
This is done so other mods can override our world generator(s) to improve or replace them.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWorldGeneratorInjector
(String newCorePackagePath) This constructor should only be used for testing different corePackagePaths. -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(IDhApiLevelWrapper levelForWorldGenerator, IDhApiWorldGenerator worldGeneratorImplementation) Binds a world generator to the given level.void
clear()
Removes all bound world generators.get
(IDhApiLevelWrapper levelForWorldGenerator) Returns the bound world generator with the highest priority.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
WorldGeneratorInjector
public WorldGeneratorInjector() -
WorldGeneratorInjector
This constructor should only be used for testing different corePackagePaths.
-
-
Method Details
-
bind
public void bind(IDhApiLevelWrapper levelForWorldGenerator, IDhApiWorldGenerator worldGeneratorImplementation) throws NullPointerException, IllegalArgumentException Binds a world generator to the given level.
Seebind(Class, IBindable)
for full documentation.- Throws:
NullPointerException
- if any parameter is nullIllegalArgumentException
- if a non-Distant Horizons world generator with the priority CORE is passed in- See Also:
-
get
public IDhApiWorldGenerator get(IDhApiLevelWrapper levelForWorldGenerator) throws ClassCastException Returns the bound world generator with the highest priority.
Returns null if no world generators have been bound for this specific level.
Seeget(Class)
for full documentation.- Throws:
ClassCastException
- See Also:
-
clear
public void clear()Removes all bound world generators.
-