Class WorldGenerator
java.lang.Object
org.bukkit.generator.ChunkGenerator
ua.mcchickenstudio.opencreative.utils.world.generators.WorldGenerator
- All Implemented Interfaces:
ExtensionContent
- Direct Known Subclasses:
AbstractFlatGenerator, EmptyGenerator, FlatGenerator, LargeBiomesGenerator, OceanGenerator, SurvivalGenerator, WorldTemplate
public abstract class WorldGenerator
extends org.bukkit.generator.ChunkGenerator
implements ExtensionContent
WorldGenerator
This class represents world generator, that can be used for generating new player worlds or on loading old worlds of planets.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.generator.ChunkGenerator
org.bukkit.generator.ChunkGenerator.BiomeGrid, org.bukkit.generator.ChunkGenerator.ChunkData -
Constructor Summary
ConstructorsConstructorDescriptionWorldGenerator(@NotNull String id, @NotNull org.bukkit.inventory.ItemStack displayIcon) Constructor of world generator. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidafterCreation(@NotNull org.bukkit.World world) Executes world operations, when it's created or loaded.org.bukkit.inventory.ItemStackReturns an icon that will be used in world generation menu.final @NotNull StringgetID()Returns id of world generator, that will be used to find it in registry.@NotNull StringReturns localized name for displaying.@NotNull StringgetName()Returns name of world generator for displaying in registry by converting id.abstract voidmodifyWorldCreator(@NotNull org.bukkit.WorldCreator creator, @NotNull String biome) Changes world creator before creating or loading world.Methods inherited from class org.bukkit.generator.ChunkGenerator
canSpawn, createChunkData, generateBedrock, generateCaves, generateChunkData, generateNoise, generateSurface, getBaseHeight, getDefaultBiomeProvider, getDefaultPopulators, getFixedSpawnLocation, isParallelCapable, shouldGenerateBedrock, shouldGenerateCaves, shouldGenerateCaves, shouldGenerateDecorations, shouldGenerateDecorations, shouldGenerateMobs, shouldGenerateMobs, shouldGenerateNoise, shouldGenerateNoise, shouldGenerateStructures, shouldGenerateStructures, shouldGenerateSurface, shouldGenerateSurfaceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ExtensionContent
getDescription, getExtensionId
-
Constructor Details
-
WorldGenerator
public WorldGenerator(@NotNull @NotNull String id, @NotNull @NotNull org.bukkit.inventory.ItemStack displayIcon) Constructor of world generator.- Parameters:
id- short id of world generator that will be used in world generation menu.It must be lower-snake-cased, for example: "flat", "nostalgia_world". If some of registered generators has same ID as new, it will be not added.
displayIcon- icon of world generator that will be displayed in world generation menu.
-
-
Method Details
-
modifyWorldCreator
public abstract void modifyWorldCreator(@NotNull @NotNull org.bukkit.WorldCreator creator, @NotNull @NotNull String biome) Changes world creator before creating or loading world. Useful to set generator as itself, if it overridesgenerateSurfacemethod.- Parameters:
creator- creator to change.biome- selected biome.
-
afterCreation
public abstract void afterCreation(@NotNull @NotNull org.bukkit.World world) Executes world operations, when it's created or loaded.- Parameters:
world- world to execute code in it.
-
getDisplayIcon
public org.bukkit.inventory.ItemStack getDisplayIcon()Returns an icon that will be used in world generation menu.- Returns:
- icon of event value to display.
-
getName
Returns name of world generator for displaying in registry by converting id. Not used in menus.- Specified by:
getNamein interfaceExtensionContent- Returns:
- display name of world generator.
-
getLocaleName
Returns localized name for displaying.- Returns:
- localized name.
-
getID
Returns id of world generator, that will be used to find it in registry.- Returns:
- id of world generator.
-