Class WorldCreator
public class WorldCreator
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description WorldCreator(java.lang.String name)
Creates an empty WorldCreationOptions for the given world name -
Method Summary
Modifier and Type Method Description WorldCreator
copy(World world)
Copies the options from the specified worldWorldCreator
copy(WorldCreator creator)
Copies the options from the specifiedWorldCreator
World
createWorld()
Creates a world with the specified options.World.Environment
environment()
Gets the environment that will be used to create or load the worldWorldCreator
environment(World.Environment env)
Sets the environment that will be used to create or load the worldboolean
generateStructures()
Gets whether or not structures will be generated in the world.WorldCreator
generateStructures(boolean generate)
Sets whether or not worlds created or loaded with this creator will have structures.ChunkGenerator
generator()
Gets the generator that will be used to create or load the world.WorldCreator
generator(java.lang.String generator)
Sets the generator that will be used to create or load the world.WorldCreator
generator(java.lang.String generator, CommandSender output)
Sets the generator that will be used to create or load the world.WorldCreator
generator(ChunkGenerator generator)
Sets the generator that will be used to create or load the world.java.lang.String
generatorSettings()
Gets the generator settings of the world that will be created or loadedWorldCreator
generatorSettings(java.lang.String generatorSettings)
Sets the generator settings of the world that will be created or loadedstatic ChunkGenerator
getGeneratorForName(java.lang.String world, java.lang.String name, CommandSender output)
Attempts to get theChunkGenerator
with the given name.java.lang.String
name()
Gets the name of the world that is to be loaded or created.static WorldCreator
name(java.lang.String name)
Creates a newWorldCreator
for the given world namelong
seed()
Gets the seed that will be used to create this worldWorldCreator
seed(long seed)
Sets the seed that will be used to create this worldWorldType
type()
Gets the type of the world that will be created or loadedWorldCreator
type(WorldType type)
Sets the type of the world that will be created or loaded
-
Constructor Details
-
WorldCreator
public WorldCreator(java.lang.String name)Creates an empty WorldCreationOptions for the given world name- Parameters:
name
- Name of the world that will be created
-
-
Method Details
-
copy
Copies the options from the specified world- Parameters:
world
- World to copy options from- Returns:
- This object, for chaining
-
copy
Copies the options from the specifiedWorldCreator
- Parameters:
creator
- World creator to copy options from- Returns:
- This object, for chaining
-
name
public java.lang.String name()Gets the name of the world that is to be loaded or created.- Returns:
- World name
-
seed
public long seed()Gets the seed that will be used to create this world- Returns:
- World seed
-
seed
Sets the seed that will be used to create this world- Parameters:
seed
- World seed- Returns:
- This object, for chaining
-
environment
Gets the environment that will be used to create or load the world- Returns:
- World environment
-
environment
Sets the environment that will be used to create or load the world- Parameters:
env
- World environment- Returns:
- This object, for chaining
-
type
Gets the type of the world that will be created or loaded- Returns:
- World type
-
type
Sets the type of the world that will be created or loaded- Parameters:
type
- World type- Returns:
- This object, for chaining
-
generator
Gets 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
-
generator
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.
- Parameters:
generator
- Chunk generator- Returns:
- This object, for chaining
-
generator
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 console.
- Parameters:
generator
- Name of the generator to use, in "plugin:id" notation- Returns:
- This object, for chaining
-
generator
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" notationoutput
-CommandSender
that will receive any error messages- Returns:
- This object, for chaining
-
generatorSettings
Sets the generator settings of the world that will be created or loaded- Parameters:
generatorSettings
- The settings that should be used by the generator- Returns:
- This object, for chaining
-
generatorSettings
public java.lang.String generatorSettings()Gets the generator settings of the world that will be created or loaded- Returns:
- The settings that should be used by the generator
-
generateStructures
Sets whether or not worlds created or loaded with this creator will have structures.- Parameters:
generate
- Whether to generate structures- Returns:
- This object, for chaining
-
generateStructures
public boolean generateStructures()Gets whether or not structures will be generated in the world.- Returns:
- True if structures will be generated
-
createWorld
Creates 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
-
name
Creates a newWorldCreator
for the given world name- Parameters:
name
- Name of the world to load or create- Returns:
- Resulting WorldCreator
-
getGeneratorForName
public static ChunkGenerator getGeneratorForName(java.lang.String world, java.lang.String name, CommandSender output)Attempts to get theChunkGenerator
with the given name.If the generator is not found, null will be returned and a message will be printed to the specified
CommandSender
explaining 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 forname
- Name of the generator to retrieveoutput
- Where to output if errors are present- Returns:
- Resulting generator, or null
-