Class CustomFlatGenerator

java.lang.Object
org.bukkit.generator.ChunkGenerator
All Implemented Interfaces:
ExtensionContent

public final class CustomFlatGenerator extends AbstractFlatGenerator

CustomFlatGenerator

This class represents a custom flat world generator, that has generation pattern to set blocks.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.generator.ChunkGenerator

    org.bukkit.generator.ChunkGenerator.BiomeGrid, org.bukkit.generator.ChunkGenerator.ChunkData
  • Field Summary

    Fields inherited from class AbstractFlatGenerator

    biome, blocks, generateTrees
    Modifier and Type
    Field
    Description
    protected org.bukkit.block.Biome
     
    protected final Map<Integer, org.bukkit.Material>
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomFlatGenerator(@NotNull String id, @NotNull org.bukkit.inventory.ItemStack displayIcon, @NotNull String generation, boolean generateTrees)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Returns description of extension content.
    @NotNull String
    Returns lower-cased simple id of extension.

    Methods inherited from class AbstractFlatGenerator

    afterCreation, canSpawn, generateSurface, getDefaultBiomeProvider, getDefaultPopulators, getFixedSpawnLocation, modifyWorldCreator
    Modifier and Type
    Method
    Description
    void
    afterCreation(@NotNull org.bukkit.World world)
    Executes world operations, when it's created or loaded.
    boolean
    canSpawn(@NotNull org.bukkit.World world, int x, int z)
     
    void
    generateSurface(@NotNull org.bukkit.generator.WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull org.bukkit.generator.ChunkGenerator.ChunkData chunkData)
     
    @Nullable org.bukkit.generator.BiomeProvider
    getDefaultBiomeProvider(@NotNull org.bukkit.generator.WorldInfo worldInfo)
     
    @NotNull List<org.bukkit.generator.BlockPopulator>
    getDefaultPopulators(@NotNull org.bukkit.World world)
     
    @Nullable org.bukkit.Location
    getFixedSpawnLocation(@NotNull org.bukkit.World world, @NotNull Random random)
     
    void
    modifyWorldCreator(@NotNull org.bukkit.WorldCreator creator, @NotNull String biome)
    Changes world creator before creating or loading world.

    Methods inherited from class WorldGenerator

    getDisplayIcon, getID, getLocaleName, getName
    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class org.bukkit.generator.ChunkGenerator

    createChunkData, generateBedrock, generateCaves, generateChunkData, generateNoise, getBaseHeight, 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
  • Constructor Details

    • CustomFlatGenerator

      public CustomFlatGenerator(@NotNull @NotNull String id, @NotNull @NotNull org.bukkit.inventory.ItemStack displayIcon, @NotNull @NotNull String generation, boolean generateTrees)
      Parameters:
      id - id of generator.
      displayIcon - icon to display.
      generation - generation pattern, that consists of amounts and material layers.
                           
                           "bedrock" // Generates only 1 layer with bedrock
                           "bedrock,2*sand" // Generates bedrock on Y = 0, and sand on Y = 1, 2.
                           "bedrock,2*air,stone" // Generates bedrock on Y = 0, and stone on Y = 3.
                           "bedrock,grass_block;ice_spikes" // Generates bedrock, grass_block with ice_spikes biome.
                            
      generateTrees - generate trees or not.
  • Method Details

    • getExtensionId

      @NotNull public @NotNull String getExtensionId()
      Description copied from interface: ExtensionContent
      Returns lower-cased simple id of extension. Will be used to identify author of content.

      ID "default" is reserved for OpenCreative+ developers.

      Returns:
      id of extension.
    • getDescription

      @NotNull public @NotNull String getDescription()
      Description copied from interface: ExtensionContent
      Returns description of extension content. Describes purpose of new additional content.
      Returns:
      description of content.