Class WorldGenerators
java.lang.Object
ua.mcchickenstudio.opencreative.utils.world.generators.WorldGenerators
WorldGenerators
This class represents world generators registry, that contains all generators, that can be used for creating or loading worlds.
To add your own world generator, create a class, that
extends WorldGenerator or AbstractFlatGenerator, then register
it with registerWorldGenerator(WorldGenerator) method.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidUnregisters all world generators.@Nullable WorldGeneratorReturns world generator from registry by specified id if it exists, otherwise will return null.Returns a list of all registered generators IDs.@NotNull List<org.bukkit.Material> Returns a list of all registered generators materials.static @NotNull WorldGeneratorsReturns instance of world generators controller class.@NotNull List<WorldGenerator> Returns a copy of list that contains all registered world generators.voidregisterWorldGenerator(@NotNull WorldGenerator generator) Registers world generator, that can be used for world generation.voidregisterWorldGenerator(@NotNull WorldGenerator... generator) Registers world generators, that can be used for world generation.voidunregisterWorldGenerator(@NotNull WorldGenerator generator) Unregisters world generator if list contains it.
-
Constructor Details
-
WorldGenerators
public WorldGenerators()
-
-
Method Details
-
getInstance
Returns instance of world generators controller class.- Returns:
- instance of world generators.
-
registerWorldGenerator
Registers world generator, that can be used for world generation.- Parameters:
generator- world generator to register.
-
registerWorldGenerator
Registers world generators, that can be used for world generation.- Parameters:
generator- world generators to register.
-
unregisterWorldGenerator
Unregisters world generator if list contains it.- Parameters:
generator- world generator to unregister.
-
clearWorldGenerators
public void clearWorldGenerators()Unregisters all world generators. -
getWorldGenerators
Returns a copy of list that contains all registered world generators.- Returns:
- world generators list.
-
getGeneratorsIDs
-
getGeneratorsMaterials
Returns a list of all registered generators materials.- Returns:
- generators materials list.
-
getById
Returns world generator from registry by specified id if it exists, otherwise will return null.- Parameters:
id- id to get world generator.- Returns:
- world generator - if exists, or null - not exists.
-