Interface Level.Builder

Enclosing interface:
Level

public static interface Level.Builder
  • Method Details

    • directory

      @Contract(pure=true) Path directory()
      Retrieves the directory path associated with the builder.
      Returns:
      the Path representing the directory, or null if no directory is set
    • directory

      @Contract(mutates="this") Level.Builder directory(Path directory)
      Sets the directory path associated with the builder.
      Parameters:
      directory - the Path representing the directory to set
      Returns:
      the builder instance for chaining method calls
    • key

      @Contract(pure=true) @Nullable net.kyori.adventure.key.Key key()
      Retrieves the key associated with the builder, if one has been set.
      Returns:
      the Key instance associated with the builder, or null if no key is set
    • key

      @Contract(mutates="this") Level.Builder key(@Nullable net.kyori.adventure.key.Key key)
      Sets the key associated with the builder.
      Parameters:
      key - the Key instance to associate with the builder, or null to unset the key
      Returns:
      the builder instance for chaining method calls
    • name

      @Contract(pure=true) @Nullable String name()
      Retrieves the name associated with the builder.
      Returns:
      the name as a String, or null if no name is set
    • name

      @Contract(mutates="this") Level.Builder name(@Nullable String name)
      Sets the name associated with the builder.
      Parameters:
      name - the name to associate with the builder, or null to unset the name
      Returns:
      the builder instance for chaining method calls
    • biomeProvider

      @Contract(pure=true) @Nullable org.bukkit.generator.BiomeProvider biomeProvider()
      Retrieves the BiomeProvider associated with the builder. The biome provider is responsible for determining which biomes will be used during world generation.
      Returns:
      the BiomeProvider instance, or null if no biome provider is set
    • biomeProvider

      @Contract(mutates="this") Level.Builder biomeProvider(@Nullable org.bukkit.generator.BiomeProvider provider)
      Sets the BiomeProvider instance for the builder. The biome provider determines how biomes are assigned and distributed in the generated world.
      Parameters:
      provider - the BiomeProvider to set, or null to remove any previously set biome provider
      Returns:
      the builder instance for chaining method calls
    • chunkGenerator

      @Contract(pure=true) @Nullable org.bukkit.generator.ChunkGenerator chunkGenerator()
      Retrieves the ChunkGenerator instance configured for the builder. The chunk generator defines how world generation is handled, including terrain creation and feature placement.
      Returns:
      the ChunkGenerator instance associated with the builder, or null if no chunk generator has been set.
    • chunkGenerator

      @Contract(mutates="this") Level.Builder chunkGenerator(@Nullable org.bukkit.generator.ChunkGenerator generator)
      Sets the ChunkGenerator instance to be used in the builder. The chunk generator defines how the world will be generated, including terrain and features.
      Parameters:
      generator - the ChunkGenerator instance to set, or null to remove the chunk generator.
      Returns:
      the builder instance for chaining method calls
    • generator

      @Contract(pure=true) @Nullable Generator generator()
      Retrieves the generator configuration if one is defined. The generator defines specific behaviors or features for customizing world generation.
      Returns:
      the Generator instance associated with the builder, or null if no generator is set
    • generator

      @Contract(mutates="this") Level.Builder generator(@Nullable Generator generator)
      Sets the generator configuration for the builder.
      Parameters:
      generator - the Generator instance to set, or null to remove the generator configuration
      Returns:
      the builder instance for chaining method calls
    • preset

      @Contract(pure=true) @Nullable Preset preset()
      Retrieves the preset configuration associated with the builder. The preset determines predefined settings for world generation.
      Returns:
      the Preset applied to the builder, or null if no preset is set
    • preset

      @Contract(mutates="this") Level.Builder preset(@Nullable Preset preset)
      Sets the preset configuration for the builder. The preset determines pre-defined settings that can be applied to the world generation.
      Parameters:
      preset - the Preset to apply to the builder, or null to leave the preset undefined
      Returns:
      the builder instance for chaining method calls
    • hardcore

      @Contract(pure=true) @Nullable Boolean hardcore()
      Retrieves whether the world is configured to be in hardcore mode.
      Returns:
      a Boolean indicating whether the world is in hardcore mode, or null if the value is not explicitly set and the server default should be used.
    • hardcore

      @Contract(mutates="this") Level.Builder hardcore(@Nullable Boolean hardcore)
      Sets whether the world will be in hardcore mode. If the value is null, the configured value will be used.
      Parameters:
      hardcore - a Boolean indicating whether the world should be in hardcore mode, or null to use the server default
      Returns:
      the builder instance for chaining method calls
    • structures

      @Contract(pure=true) @Nullable Boolean structures()
      Retrieves whether structures should be generated in the world.
      Returns:
      a Boolean indicating whether structures should be generated, or null if the server default should be used
    • structures

      @Contract(mutates="this") Level.Builder structures(@Nullable Boolean structures)
      Sets whether structures should be generated in the world. If the value is null, the configured value will be used.
      Parameters:
      structures - a Boolean indicating whether structures should be generated, or null to use the server default
      Returns:
      the builder instance for chaining method calls
    • bonusChest

      @Contract(pure=true) @Nullable Boolean bonusChest()
      Retrieves whether a bonus chest should be generated in the world.
      Returns:
      a Boolean indicating whether a bonus chest should be generated.
    • bonusChest

      @Contract(mutates="this") Level.Builder bonusChest(@Nullable Boolean bonusChest)
      Sets whether a bonus chest should be generated in the world. A bonus chest is a starting chest containing basic resources to help players begin their journey.
      Parameters:
      bonusChest - a Boolean specifying whether a bonus chest should be generated, or null to leave the value unset
      Returns:
      the builder instance for chaining method calls
    • spawnChunkRadius

      @Contract(pure=true) @Deprecated(forRemoval=true, since="3.3.1") @Nullable Integer spawnChunkRadius()
      Deprecated, for removal: This API element is subject to removal in a future version.
      spawn chunks will be removed in the next release of minecraft
      Retrieves the configured radius of chunks around the spawn point that should remain loaded.
      Returns:
      an Integer representing the radius of spawn chunks to keep loaded, or null if the default value is to be used.
    • spawnChunkRadius

      @Contract(mutates="this") @Deprecated(forRemoval=true, since="3.3.1") Level.Builder spawnChunkRadius(@Nullable Integer radius)
      Deprecated, for removal: This API element is subject to removal in a future version.
      spawn chunks will be removed in the next release of minecraft
      Sets the radius of chunks around the spawn point that should remain loaded. If the value is null, the configured value will be used.
      Parameters:
      radius - an Integer representing the radius of chunks to keep loaded, or null to use the server default
      Returns:
      the builder instance for chaining method calls
    • seed

      @Contract(pure=true) @Nullable Long seed()
      Retrieves the world seed used for generation, if available.
      Returns:
      the seed as a Long, or null if no seed is set
    • seed

      @Contract(mutates="this") Level.Builder seed(@Nullable Long seed)
      Sets the world seed.
      Parameters:
      seed - the seed to use for world generation, or null to generate a random seed
      Returns:
      this builder instance for chaining method calls
    • build

      @Contract(pure=true) Level build()
      Constructs a new Level instance based on the current state of the builder.
      Returns:
      the constructed Level instance
    • levelStem

      @Contract(pure=true) @Experimental @Nullable LevelStem levelStem()
    • levelStem

      @Experimental @Contract(mutates="this") Level.Builder levelStem(@Nullable LevelStem type)
    • generatorType

      @Contract(pure=true) @Experimental @Nullable GeneratorType generatorType()
    • generatorType

      @Experimental @Contract(mutates="this") Level.Builder generatorType(@Nullable GeneratorType type)
    • worldKnown

      @Internal @Contract(pure=true) @Nullable Boolean worldKnown()
    • worldKnown

      @Internal @Contract(mutates="this") Level.Builder worldKnown(@Nullable Boolean worldKnown)
    • enabled

      @Internal @Contract(pure=true) net.kyori.adventure.util.TriState enabled()
    • enabled

      @Internal @Contract(mutates="this") Level.Builder enabled(net.kyori.adventure.util.TriState enabled)