Package net.thenextlvl.worlds.api.level
Interface Level.Builder
- Enclosing interface:
Level
public static interface Level.Builder
-
Method Summary
Modifier and TypeMethodDescription@Nullable org.bukkit.generator.BiomeProviderRetrieves theBiomeProviderassociated with the builder.biomeProvider(@Nullable org.bukkit.generator.BiomeProvider provider) Sets theBiomeProviderinstance for the builder.@Nullable BooleanRetrieves whether a bonus chest should be generated in the world.bonusChest(@Nullable Boolean bonusChest) Sets whether a bonus chest should be generated in the world.build()Constructs a new Level instance based on the current state of the builder.@Nullable org.bukkit.generator.ChunkGeneratorRetrieves theChunkGeneratorinstance configured for the builder.chunkGenerator(@Nullable org.bukkit.generator.ChunkGenerator generator) Sets theChunkGeneratorinstance to be used in the builder.Retrieves the directory path associated with the builder.Sets the directory path associated with the builder.net.kyori.adventure.util.TriStateenabled()enabled(net.kyori.adventure.util.TriState enabled) @Nullable GeneratorRetrieves the generator configuration if one is defined.Sets the generator configuration for the builder.@Nullable GeneratorTypegeneratorType(@Nullable GeneratorType type) @Nullable Booleanhardcore()Retrieves whether the world is configured to be in hardcore mode.Sets whether the world will be in hardcore mode.@Nullable net.kyori.adventure.key.Keykey()Retrieves the key associated with the builder, if one has been set.key(@Nullable net.kyori.adventure.key.Key key) Sets the key associated with the builder.@Nullable LevelStem@Nullable Stringname()Retrieves the name associated with the builder.Sets the name associated with the builder.@Nullable Presetpreset()Retrieves the preset configuration associated with the builder.Sets the preset configuration for the builder.@Nullable Longseed()Retrieves the world seed used for generation, if available.Sets the world seed.@Nullable IntegerDeprecated, for removal: This API element is subject to removal in a future version.spawn chunks will be removed in the next release of minecraftspawnChunkRadius(@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@Nullable BooleanRetrieves whether structures should be generated in the world.structures(@Nullable Boolean structures) Sets whether structures should be generated in the world.@Nullable BooleanworldKnown(@Nullable Boolean worldKnown)
-
Method Details
-
directory
Retrieves the directory path associated with the builder.- Returns:
- the
Pathrepresenting the directory, or null if no directory is set
-
directory
Sets the directory path associated with the builder.- Parameters:
directory- thePathrepresenting 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
Keyinstance associated with the builder, or null if no key is set
-
key
Sets the key associated with the builder.- Parameters:
key- theKeyinstance to associate with the builder, or null to unset the key- Returns:
- the builder instance for chaining method calls
-
name
Retrieves the name associated with the builder.- Returns:
- the name as a
String, or null if no name is set
-
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 theBiomeProviderassociated with the builder. The biome provider is responsible for determining which biomes will be used during world generation.- Returns:
- the
BiomeProviderinstance, or null if no biome provider is set
-
biomeProvider
@Contract(mutates="this") Level.Builder biomeProvider(@Nullable org.bukkit.generator.BiomeProvider provider) Sets theBiomeProviderinstance for the builder. The biome provider determines how biomes are assigned and distributed in the generated world.- Parameters:
provider- theBiomeProviderto 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 theChunkGeneratorinstance configured for the builder. The chunk generator defines how world generation is handled, including terrain creation and feature placement.- Returns:
- the
ChunkGeneratorinstance 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 theChunkGeneratorinstance to be used in the builder. The chunk generator defines how the world will be generated, including terrain and features.- Parameters:
generator- theChunkGeneratorinstance to set, or null to remove the chunk generator.- Returns:
- the builder instance for chaining method calls
-
generator
Retrieves the generator configuration if one is defined. The generator defines specific behaviors or features for customizing world generation.- Returns:
- the
Generatorinstance associated with the builder, or null if no generator is set
-
generator
Sets the generator configuration for the builder.- Parameters:
generator- theGeneratorinstance to set, or null to remove the generator configuration- Returns:
- the builder instance for chaining method calls
-
preset
Retrieves the preset configuration associated with the builder. The preset determines predefined settings for world generation.- Returns:
- the
Presetapplied to the builder, or null if no preset is set
-
preset
Sets the preset configuration for the builder. The preset determines pre-defined settings that can be applied to the world generation.- Parameters:
preset- thePresetto apply to the builder, or null to leave the preset undefined- Returns:
- the builder instance for chaining method calls
-
hardcore
Retrieves whether the world is configured to be in hardcore mode.- Returns:
- a
Booleanindicating whether the world is in hardcore mode, or null if the value is not explicitly set and the server default should be used.
-
hardcore
Sets whether the world will be in hardcore mode. If the value is null, theconfigured valuewill be used.- Parameters:
hardcore- aBooleanindicating whether the world should be in hardcore mode, or null to use the server default- Returns:
- the builder instance for chaining method calls
-
structures
Retrieves whether structures should be generated in the world.- Returns:
- a
Booleanindicating whether structures should be generated, or null if the server default should be used
-
structures
Sets whether structures should be generated in the world. If the value is null, theconfigured valuewill be used.- Parameters:
structures- aBooleanindicating whether structures should be generated, or null to use the server default- Returns:
- the builder instance for chaining method calls
-
bonusChest
Retrieves whether a bonus chest should be generated in the world.- Returns:
- a
Booleanindicating whether a bonus chest should be generated.
-
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- aBooleanspecifying 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 minecraftRetrieves the configured radius of chunks around the spawn point that should remain loaded.- Returns:
- an
Integerrepresenting 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 minecraftSets the radius of chunks around the spawn point that should remain loaded. If the value is null, theconfigured valuewill be used.- Parameters:
radius- anIntegerrepresenting the radius of chunks to keep loaded, or null to use the server default- Returns:
- the builder instance for chaining method calls
-
seed
Retrieves the world seed used for generation, if available.- Returns:
- the seed as a
Long, or null if no seed is set
-
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
Constructs a new Level instance based on the current state of the builder.- Returns:
- the constructed Level instance
-
levelStem
-
levelStem
-
generatorType
-
generatorType
-
worldKnown
-
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)
-