Class CreateWorldOptions
java.lang.Object
org.mvplugins.multiverse.core.world.options.CreateWorldOptions
Options for customizing the creation of a new world.
-
Method Summary
Modifier and TypeMethodDescription@NotNull Stringbiome()Gets the single biome used for this world.@NotNull CreateWorldOptionsSets the single biome used for this world.booleanGets whether bonus chest should generate at spawn upon world creation.@NotNull CreateWorldOptionsbonusChest(boolean bonusChest) Sets whether bonus chest should generate at spawn upon world creation.booleanGets whether to ensure folder does not exist before creating the world.@NotNull CreateWorldOptionsdoFolderCheck(boolean doFolderCheckInput) Sets whether to ensure folder does not exist before creating the world.org.bukkit.World.EnvironmentGets the environment of the world to create.@NotNull CreateWorldOptionsenvironment(org.bukkit.World.Environment environmentInput) Sets the environment of the world to create.@NotNull io.vavr.control.Option<EntityPosition> Sets the forced spawn position of the world to apply.@NotNull CreateWorldOptionsforcedSpawnPosition(@Nullable EntityPosition forcedSpawnPosition) Sets the forced spawn position of the world to apply.booleanGets whether structures such as NPC villages should be generated.@NotNull CreateWorldOptionsgenerateStructures(boolean generateStructuresInput) Sets whether structures such as NPC villages should be generated.@Nullable StringGets the custom generator plugin and its parameters.@NotNull CreateWorldOptionsSets the custom generator plugin and its parameters.@NotNull StringGets the generator settings of the world that will be created or loaded.@NotNull CreateWorldOptionsgeneratorSettings(@NotNull String generatorSettings) Sets the generator settings of the world that will be created or loaded.@NotNull io.vavr.control.Either<String, WorldKeyOrName> Gets the new world key or name, either unparsed as string or theWorldKeyOrNameinstance.longseed()Gets the seed of the world to create.@NotNull CreateWorldOptionsseed(long seedInput) Sets the seed of the world to create.@NotNull CreateWorldOptionsSets the seed of the world to create.booleanGets whether multiverse will search for a safe spawn location.@NotNull CreateWorldOptionsuseSpawnAdjust(boolean useSpawnAdjustInput) Sets whether multiverse will search for a safe spawn location.static @NotNull CreateWorldOptionsworldKey(@NotNull org.bukkit.NamespacedKey key) Creates a newCreateWorldOptionsinstance with the given namespaced key.static @NotNull CreateWorldOptionsworldKeyOrName(@NotNull WorldKeyOrName keyOrName) Creates a newCreateWorldOptionsinstance with the given world key or name.@NotNull StringDeprecated, for removal: This API element is subject to removal in a future version.static @NotNull CreateWorldOptionsCreates a newCreateWorldOptionsinstance with the given world name.@NotNull CreateWorldOptionsworldPropertyString(@NotNull String key, @Nullable String value) Sets a world property string key-value pair.Gets an unmodifiable view of the world property strings.@NotNull CreateWorldOptionsworldPropertyStrings(@NotNull Map<@NotNull String, @Nullable String> worldProperties) Sets multiple world property string key-value pairs.@NotNull org.bukkit.WorldTypeGets the world type.@NotNull CreateWorldOptionsworldType(@NotNull org.bukkit.WorldType worldTypeInput) Sets the world type.
-
Method Details
-
worldName
Creates a newCreateWorldOptionsinstance with the given world name.- Parameters:
worldName- The name of the world to create.- Returns:
- A new
CreateWorldOptionsinstance.
-
worldKey
@AvailableSince("5.7") @NotNull public static @NotNull CreateWorldOptions worldKey(@NotNull @NotNull org.bukkit.NamespacedKey key) Creates a newCreateWorldOptionsinstance with the given namespaced key. Note that creating world with namespace requires PaperMC. This will not work on Spigot.- Parameters:
key- The namespaced key for the world to create.- Returns:
- A new
CreateWorldOptionsinstance. - Since:
- 5.7
-
worldKeyOrName
@AvailableSince("5.7") @NotNull public static @NotNull CreateWorldOptions worldKeyOrName(@NotNull @NotNull WorldKeyOrName keyOrName) Creates a newCreateWorldOptionsinstance with the given world key or name. Note that creating world with namespace requires PaperMC. WorldKeyOrName parsed as namespaced key (i.e.WorldKeyOrName.isKey()is true) will not work on Spigot.- Parameters:
keyOrName- The key or name for the world to create.- Returns:
- A new
CreateWorldOptionsinstance. - Since:
- 5.7
-
keyOrName
@AvailableSince("5.7") @NotNull public @NotNull io.vavr.control.Either<String,WorldKeyOrName> keyOrName()Gets the new world key or name, either unparsed as string or theWorldKeyOrNameinstance.- Returns:
- The new world key or name.
- Since:
- 5.7
-
worldName
Deprecated, for removal: This API element is subject to removal in a future version.Gets the name of the world to create.- Returns:
- The name of the world to create.
-
biome
Sets the single biome used for this world. This may be null, in which case the biome from the generator will be used. If no generator is specified, the "natural" biome behaviour for this environment will be used.- Parameters:
biome- The biome used for this world- Returns:
- This
CreateWorldOptionsinstance.
-
biome
Gets the single biome used for this world. This may be null, in which case the biome from the generator will be used. If no generator is specified, the "natural" biome behaviour for this environment will be used.- Returns:
- The biome used for this world
-
bonusChest
Sets whether bonus chest should generate at spawn upon world creation.
This feature only works on PaperMC 1.21.5+- Parameters:
bonusChest- Whether bonus chest should generate at spawn upon world creation.- Returns:
- This
CreateWorldOptionsinstance.
-
bonusChest
@AvailableSince("5.7") public boolean bonusChest()Gets whether bonus chest should generate at spawn upon world creation.
This feature only works on PaperMC 1.21.5+- Returns:
- true if bonus chest should generate, else false.
-
environment
@NotNull public @NotNull CreateWorldOptions environment(@NotNull org.bukkit.World.Environment environmentInput) Sets the environment of the world to create.- Parameters:
environmentInput- The environment of the world to create.- Returns:
- This
CreateWorldOptionsinstance.
-
environment
@NotNull public org.bukkit.World.Environment environment()Gets the environment of the world to create.- Returns:
- The environment of the world to create.
-
forcedSpawnPosition
@AvailableSince("5.7") @NotNull public @NotNull CreateWorldOptions forcedSpawnPosition(@Nullable @Nullable EntityPosition forcedSpawnPosition) Sets the forced spawn position of the world to apply. This may be null, in which case the spawn position will be determined by the default generator. Setting spawn position anduseSpawnAdjust(boolean)to false will improve world creation speed on PaperMC as chunks will not be loaded to search for spawn point.
This feature only works on PaperMC 26.1+- Parameters:
forcedSpawnPosition- The forced spawn position of the world to create.- Returns:
- This
CreateWorldOptionsinstance. - Since:
- 5.7
-
forcedSpawnPosition
@AvailableSince("5.7") @NotNull public @NotNull io.vavr.control.Option<EntityPosition> forcedSpawnPosition()Sets the forced spawn position of the world to apply. This may be null, in which case the spawn position will be determined by the default generator.
This feature only works on PaperMC 26.1+- Returns:
- The force spawn position to apply if available.
-
generateStructures
Sets whether structures such as NPC villages should be generated.- Parameters:
generateStructuresInput- Whether structures such as NPC villages should be generated.- Returns:
- This
CreateWorldOptionsinstance.
-
generateStructures
public boolean generateStructures()Gets whether structures such as NPC villages should be generated.- Returns:
- Whether structures such as NPC villages should be generated.
-
generator
Sets the custom generator plugin and its parameters.- Parameters:
generatorInput- The custom generator plugin and its parameters.- Returns:
- This
CreateWorldOptionsinstance.
-
generator
Gets the custom generator plugin and its parameters.- Returns:
- The custom generator plugin and its parameters.
-
generatorSettings
@NotNull public @NotNull CreateWorldOptions generatorSettings(@NotNull @NotNull String generatorSettings) Sets 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:
-
generatorSettings
Gets the generator settings of the world that will be created or loaded.- Returns:
- The generator settings of the world that will be created or loaded
-
seed
Sets the seed of the world to create. If the seed is a number, it will be parsed as a long. Otherwise, it will be hashed.- Parameters:
seedInput- The seed of the world to create.- Returns:
- This
CreateWorldOptionsinstance.
-
seed
Sets the seed of the world to create.- Parameters:
seedInput- The seed of the world to create.- Returns:
- This
CreateWorldOptionsinstance.
-
seed
public long seed()Gets the seed of the world to create.- Returns:
- The seed of the world to create.
-
useSpawnAdjust
Sets whether multiverse will search for a safe spawn location.- Parameters:
useSpawnAdjustInput- Whether multiverse will search for a safe spawn location.- Returns:
- This
CreateWorldOptionsinstance.
-
useSpawnAdjust
public boolean useSpawnAdjust()Gets whether multiverse will search for a safe spawn location.- Returns:
- Whether multiverse will search for a safe spawn location.
-
worldType
@NotNull public @NotNull CreateWorldOptions worldType(@NotNull @NotNull org.bukkit.WorldType worldTypeInput) Sets the world type.- Parameters:
worldTypeInput- The world type.- Returns:
- This
CreateWorldOptionsinstance.
-
worldType
@NotNull public @NotNull org.bukkit.WorldType worldType()Gets the world type.- Returns:
- The world type.
-
doFolderCheck
Sets whether to ensure folder does not exist before creating the world.- Parameters:
doFolderCheckInput- Whether to do the folder check- Returns:
- This
CreateWorldOptionsinstance
-
doFolderCheck
public boolean doFolderCheck()Gets whether to ensure folder does not exist before creating the world.- Returns:
- Whether to do the folder check
-
worldPropertyString
@AvailableSince("5.5") @NotNull public @NotNull CreateWorldOptions worldPropertyString(@NotNull @NotNull String key, @Nullable @Nullable String value) Sets a world property string key-value pair. Overwrites any existing key.- Parameters:
key- The key of the world property string.value- The value of the world property string.- Returns:
- This
CreateWorldOptionsinstance. - Since:
- 5.5
-
worldPropertyStrings
@AvailableSince("5.5") @NotNull public @NotNull CreateWorldOptions worldPropertyStrings(@NotNull @NotNull Map<@NotNull String, @Nullable String> worldProperties) Sets multiple world property string key-value pairs. Overwrites any existing keys.- Parameters:
worldProperties- A map of world property string key-value pairs.- Returns:
- This
CreateWorldOptionsinstance. - Since:
- 5.5
-
worldPropertyStrings
@AvailableSince("5.5") @NotNull public @UnmodifiableView @NotNull Map<String,String> worldPropertyStrings()Gets an unmodifiable view of the world property strings. UseworldPropertyString(String, String)andworldPropertyStrings(Map)to modify the world property strings.- Returns:
- An unmodifiable view of the world property strings.
- Since:
- 5.5
-