Class WorldCreator
- 
Constructor SummaryConstructorsConstructorDescriptionWorldCreator(@NotNull String name) Creates an empty WorldCreationOptions for the given world nameWorldCreator(@NotNull String levelName, @NotNull NamespacedKey worldKey) Creates an empty WorldCreator for the given world name and keyWorldCreator(@NotNull NamespacedKey worldKey) Creates an empty WorldCreator for the given key.
- 
Method SummaryModifier and TypeMethodDescriptionGets the biome provider that will be used to create or load the world.biomeProvider(@Nullable String biomeProvider) Sets the biome provider that will be used to create or load the world.biomeProvider(@Nullable String biomeProvider, @Nullable CommandSender output) Sets the biome provider that will be used to create or load the world.biomeProvider(@Nullable BiomeProvider biomeProvider) Sets the biome provider that will be used to create or load the world.Copies the options from the specified worldcopy(@NotNull WorldCreator creator) Copies the options from the specifiedWorldCreatorCreates a world with the specified options.Gets the environment that will be used to create or load the worldSets the environment that will be used to create or load the worldbooleanGets whether or not structures will be generated in the world.generateStructures(boolean generate) Sets whether or not worlds created or loaded with this creator will have structures.Gets the generator that will be used to create or load the world.Sets the generator that will be used to create or load the world.generator(@Nullable String generator, @Nullable CommandSender output) Sets the generator that will be used to create or load the world.generator(@Nullable ChunkGenerator generator) Sets the generator that will be used to create or load the world.Gets the generator settings of the world that will be created or loaded.generatorSettings(@NotNull String generatorSettings) Sets the generator settings of the world that will be created or loaded.static @Nullable BiomeProvidergetBiomeProviderForName(@NotNull String world, @Nullable String name, @Nullable CommandSender output) Attempts to get theBiomeProviderwith the given name.static @Nullable ChunkGeneratorgetGeneratorForName(@NotNull String world, @Nullable String name, @Nullable CommandSender output) Attempts to get theChunkGeneratorwith the given name.booleanhardcore()Gets whether the world will be hardcore or not.hardcore(boolean hardcore) Sets whether the world will be hardcore or not.Returns the current intent to keep the world loaded, @seekeepSpawnLoaded(net.kyori.adventure.util.TriState)keepSpawnLoaded(TriState keepSpawnLoaded) Controls if a world should be kept loaded or not, default (NOT_SET) will use the servers standard configuration, otherwise, will act as an override towards this settingkey()Gets the key for this WorldCreatorname()Gets the name of the world that is to be loaded or created.static @NotNull WorldCreatorCreates a newWorldCreatorfor the given world namestatic @NotNull WorldCreatorofKey(@NotNull NamespacedKey worldKey) Creates an empty WorldCreator for the given key.static @NotNull WorldCreatorofNameAndKey(@NotNull String levelName, @NotNull NamespacedKey worldKey) Creates an empty WorldCreator for the given world name and keylongseed()Gets the seed that will be used to create this worldseed(long seed) Sets the seed that will be used to create this worldtype()Gets the type of the world that will be created or loadedSets the type of the world that will be created or loaded
- 
Constructor Details- 
WorldCreatorCreates an empty WorldCreationOptions for the given world name- Parameters:
- name- Name of the world that will be created
 
- 
WorldCreatorCreates an empty WorldCreator for the given world name and key- Parameters:
- levelName- LevelName of the world that will be created
- worldKey- NamespacedKey of the world that will be created
 
- 
WorldCreatorCreates an empty WorldCreator for the given key. LevelName will be the Key part of the NamespacedKey.- Parameters:
- worldKey- NamespacedKey of the world that will be created
 
 
- 
- 
Method Details- 
keyGets the key for this WorldCreator- Returns:
- the key
 
- 
ofNameAndKey@NotNull public static @NotNull WorldCreator ofNameAndKey(@NotNull @NotNull String levelName, @NotNull @NotNull NamespacedKey worldKey) Creates an empty WorldCreator for the given world name and key- Parameters:
- levelName- LevelName of the world that will be created
- worldKey- NamespacedKey of the world that will be created
 
- 
ofKeyCreates an empty WorldCreator for the given key. LevelName will be the Key part of the NamespacedKey.- Parameters:
- worldKey- NamespacedKey of the world that will be created
 
- 
copyCopies the options from the specified world- Parameters:
- world- World to copy options from
- Returns:
- This object, for chaining
 
- 
copyCopies the options from the specifiedWorldCreator- Parameters:
- creator- World creator to copy options from
- Returns:
- This object, for chaining
 
- 
nameGets the name of the world that is to be loaded or created.- Returns:
- World name
 
- 
seedpublic long seed()Gets the seed that will be used to create this world- Returns:
- World seed
 
- 
seedSets the seed that will be used to create this world- Parameters:
- seed- World seed
- Returns:
- This object, for chaining
 
- 
environmentGets the environment that will be used to create or load the world- Returns:
- World environment
 
- 
environmentSets the environment that will be used to create or load the world- Parameters:
- env- World environment
- Returns:
- This object, for chaining
 
- 
typeGets the type of the world that will be created or loaded- Returns:
- World type
 
- 
typeSets the type of the world that will be created or loaded- Parameters:
- type- World type
- Returns:
- This object, for chaining
 
- 
generatorGets the generator that will be used to create or load the world.This may be null, in which case the "natural" generator for this environment will be used. - Returns:
- Chunk generator
 
- 
generatorSets the generator that will be used to create or load the world.This may be null, in which case the "natural" generator for this environment will be used. - Parameters:
- generator- Chunk generator
- Returns:
- This object, for chaining
 
- 
generatorSets the generator that will be used to create or load the world.This may be null, in which case the "natural" generator for this environment will be used. If the generator cannot be found for the given name, the natural environment generator will be used instead and a warning will be printed to the console. - Parameters:
- generator- Name of the generator to use, in "plugin:id" notation
- Returns:
- This object, for chaining
 
- 
generator@NotNull public @NotNull WorldCreator generator(@Nullable @Nullable String generator, @Nullable @Nullable CommandSender output) Sets the generator that will be used to create or load the world.This may be null, in which case the "natural" generator for this environment will be used. If the generator cannot be found for the given name, the natural environment generator will be used instead and a warning will be printed to the specified output - Parameters:
- generator- Name of the generator to use, in "plugin:id" notation
- output-- CommandSenderthat will receive any error messages
- Returns:
- This object, for chaining
 
- 
biomeProviderGets the biome provider that will be used to create or load the world.This may be null, in which case the biome provider from the ChunkGeneratorwill be used. If noChunkGeneratoris specific the "natural" biome provider for this environment will be used.- Returns:
- Biome provider
 
- 
biomeProvider@NotNull public @NotNull WorldCreator biomeProvider(@Nullable @Nullable BiomeProvider biomeProvider) Sets the biome provider that will be used to create or load the world.This may be null, in which case the biome provider from the ChunkGeneratorwill be used. If noChunkGeneratoris specific the "natural" biome provider for this environment will be used.- Parameters:
- biomeProvider- Biome provider
- Returns:
- This object, for chaining
 
- 
biomeProviderSets the biome provider that will be used to create or load the world.This may be null, in which case the biome provider from the ChunkGeneratorwill be used. If noChunkGeneratoris specific the "natural" biome provider for this environment will be used.If the biome provider cannot be found for the given name and no ChunkGeneratoris specific, the natural environment biome provider will be used instead and a warning will be printed to the specified output- Parameters:
- biomeProvider- Name of the biome provider to use, in "plugin:id" notation
- Returns:
- This object, for chaining
 
- 
biomeProvider@NotNull public @NotNull WorldCreator biomeProvider(@Nullable @Nullable String biomeProvider, @Nullable @Nullable CommandSender output) Sets the biome provider that will be used to create or load the world.This may be null, in which case the biome provider from the ChunkGeneratorwill be used. If noChunkGeneratoris specific the "natural" biome provider for this environment will be used.If the biome provider cannot be found for the given name and no ChunkGeneratoris specific, the natural environment biome provider will be used instead and a warning will be printed to the specified output- Parameters:
- biomeProvider- Name of the biome provider to use, in "plugin:id" notation
- output-- CommandSenderthat will receive any error messages
- Returns:
- This object, for chaining
 
- 
generatorSettingsSets the generator settings of the world that will be created or loaded.Currently only WorldType.FLATuses these settings, and expects them to be in JSON format with a valid biome (1.18.2 and above) defined. An example valid configuration is as follows:{"layers": [{"block": "stone", "height": 1}, {"block": "grass_block", "height": 1}], "biome":"plains"}- Parameters:
- generatorSettings- The settings that should be used by the generator
- Returns:
- This object, for chaining
- See Also:
- 
- Custom
 dimension (scroll to "When the generator ID type is
 minecraft:flat)"
 
- Custom
 dimension (scroll to "When the generator ID type is
 
 
- 
generatorSettingsGets the generator settings of the world that will be created or loaded.- Returns:
- The settings that should be used by the generator
- See Also:
 
- 
generateStructuresSets whether or not worlds created or loaded with this creator will have structures.- Parameters:
- generate- Whether to generate structures
- Returns:
- This object, for chaining
 
- 
generateStructurespublic boolean generateStructures()Gets whether or not structures will be generated in the world.- Returns:
- True if structures will be generated
 
- 
hardcoreSets whether the world will be hardcore or not. In a hardcore world the difficulty will be locked to hard.- Parameters:
- hardcore- Whether the world will be hardcore
- Returns:
- This object, for chaining
 
- 
hardcorepublic boolean hardcore()Gets whether the world will be hardcore or not. In a hardcore world the difficulty will be locked to hard.- Returns:
- hardcore status
 
- 
createWorldCreates a world with the specified options.If the world already exists, it will be loaded from disk and some options may be ignored. - Returns:
- Newly created or loaded world
 
- 
nameCreates a newWorldCreatorfor the given world name- Parameters:
- name- Name of the world to load or create
- Returns:
- Resulting WorldCreator
 
- 
getGeneratorForName@Nullable public static @Nullable ChunkGenerator getGeneratorForName(@NotNull @NotNull String world, @Nullable @Nullable String name, @Nullable @Nullable CommandSender output) Attempts to get theChunkGeneratorwith the given name.If the generator is not found, null will be returned and a message will be printed to the specified CommandSenderexplaining why.The name must be in the "plugin:id" notation, or optionally just "plugin", where "plugin" is the safe-name of a plugin and "id" is an optional unique identifier for the generator you wish to request from the plugin. - Parameters:
- world- Name of the world this will be used for
- name- Name of the generator to retrieve
- output- Where to output if errors are present
- Returns:
- Resulting generator, or null
 
- 
getBiomeProviderForName@Nullable public static @Nullable BiomeProvider getBiomeProviderForName(@NotNull @NotNull String world, @Nullable @Nullable String name, @Nullable @Nullable CommandSender output) Attempts to get theBiomeProviderwith the given name.If the biome provider is not found, null will be returned and a message will be printed to the specified CommandSenderexplaining why.The name must be in the "plugin:id" notation, or optionally just "plugin", where "plugin" is the safe-name of a plugin and "id" is an optional unique identifier for the biome provider you wish to request from the plugin. - Parameters:
- world- Name of the world this will be used for
- name- Name of the biome provider to retrieve
- output- Where to output if errors are present
- Returns:
- Resulting biome provider, or null
 
- 
keepSpawnLoadedReturns the current intent to keep the world loaded, @seekeepSpawnLoaded(net.kyori.adventure.util.TriState)- Returns:
- the current tristate value
 
- 
keepSpawnLoadedControls if a world should be kept loaded or not, default (NOT_SET) will use the servers standard configuration, otherwise, will act as an override towards this setting- Parameters:
- keepSpawnLoaded- the new value
- Returns:
- This object, for chaining
 
 
-