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

    Constructors
    Constructor
    Description
    WorldGenerator(@NotNull String id, @NotNull org.bukkit.inventory.ItemStack displayIcon)
    Constructor of world generator.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    afterCreation(@NotNull org.bukkit.World world)
    Executes world operations, when it's created or loaded.
    org.bukkit.inventory.ItemStack
    Returns an icon that will be used in world generation menu.
    final @NotNull String
    Returns id of world generator, that will be used to find it in registry.
    @NotNull String
    Returns localized name for displaying.
    @NotNull String
    Returns name of world generator for displaying in registry by converting id.
    abstract void
    modifyWorldCreator(@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, shouldGenerateSurface

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ExtensionContent

    getDescription, getExtensionId
    Modifier and Type
    Method
    Description
    @NotNull String
    Returns description of extension content.
    @NotNull String
    Returns lower-cased simple id of extension.
  • 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 overrides generateSurface method.
      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

      @NotNull public @NotNull String getName()
      Returns name of world generator for displaying in registry by converting id. Not used in menus.
      Specified by:
      getName in interface ExtensionContent
      Returns:
      display name of world generator.
    • getLocaleName

      @NotNull public @NotNull String getLocaleName()
      Returns localized name for displaying.
      Returns:
      localized name.
    • getID

      @NotNull public final @NotNull String getID()
      Returns id of world generator, that will be used to find it in registry.
      Returns:
      id of world generator.