public interface WorldBuilder
World
s and WorldCreationSettings
.Modifier and Type | Method and Description |
---|---|
Optional<World> |
build()
Attempts to create a
World from the specified parameters. |
WorldCreationSettings |
buildSettings()
Attempts to create a
WorldCreationSettings which may be later
used to create a world. |
WorldBuilder |
dimensionType(DimensionType type)
Sets the dimension type of the world.
|
WorldBuilder |
enabled(boolean state)
Sets the world as enabled.
|
WorldBuilder |
fill(WorldCreationSettings settings)
Fills this
WorldBuilder for creating World s or
WorldCreationSettings s, the builder is then seeded with the
values from the given WorldCreationSettings object. |
WorldBuilder |
fill(WorldProperties properties)
Fills this
WorldBuilder for creating World s or
WorldCreationSettings s, the builder is then seeded with the
values from the given WorldProperties object. |
WorldBuilder |
gameMode(GameMode gameMode)
Sets the default
GameMode of the world. |
WorldBuilder |
generator(GeneratorType type)
Sets the generator type of the world.
|
WorldBuilder |
generatorModifiers(WorldGeneratorModifier... modifier)
Sets the generator modifiers to use for the world.
|
WorldBuilder |
generatorSettings(DataContainer settings)
Sets any extra settings required by the
GeneratorType or by the
WorldGeneratorModifier s. |
WorldBuilder |
hardcore(boolean enabled)
Sets whether hardcore mode is enabled.
|
WorldBuilder |
keepsSpawnLoaded(boolean state)
Sets whether the spawn chunks of the world should remain loaded when no
players are present.
|
WorldBuilder |
loadsOnStartup(boolean state)
Sets whether the world should load when the server starts up.
|
WorldBuilder |
name(String name)
Sets the name of the world.
|
WorldBuilder |
reset()
Resets this builder to a clean state.
|
WorldBuilder |
seed(long seed)
Sets the seed of the world.
|
WorldBuilder |
teleporterAgent(TeleporterAgent agent) |
WorldBuilder |
usesMapFeatures(boolean enabled)
Sets whether this world should generate map features such as villages and
strongholds.
|
WorldBuilder fill(WorldCreationSettings settings)
WorldBuilder
for creating World
s or
WorldCreationSettings
s, the builder is then seeded with the
values from the given WorldCreationSettings object.settings
- The seed settingsWorldBuilder fill(WorldProperties properties)
WorldBuilder
for creating World
s or
WorldCreationSettings
s, the builder is then seeded with the
values from the given WorldProperties object.properties
- The seed propertiesWorldBuilder name(String name)
name
- The nameWorldBuilder enabled(boolean state)
Entity.transferToWorld(java.lang.String, com.flowpowered.math.vector.Vector3d)
.state
- Should be enabledWorldBuilder loadsOnStartup(boolean state)
state
- Should load on startupWorldBuilder keepsSpawnLoaded(boolean state)
state
- Should keep spawn loadedWorldBuilder seed(long seed)
seed
- The seedWorldBuilder gameMode(GameMode gameMode)
GameMode
of the world. If not specified this
will default to GameModes.SURVIVAL
.gameMode
- The gamemodeWorldBuilder generator(GeneratorType type)
type
- The typeWorldBuilder generatorModifiers(WorldGeneratorModifier... modifier)
modifier
- The modifiersIllegalArgumentException
- If one of the modifiers is not
registered in GameRegistry
.WorldBuilder dimensionType(DimensionType type)
type
- The typeWorldBuilder usesMapFeatures(boolean enabled)
enabled
- Are map features enabledWorldBuilder hardcore(boolean enabled)
enabled
- Is hardcore mode enabledWorldBuilder generatorSettings(DataContainer settings)
GeneratorType
or by the
WorldGeneratorModifier
s. If not specified these will default to
the settings within GeneratorType.getGeneratorSettings()
.settings
- The generator settingsWorldBuilder teleporterAgent(TeleporterAgent agent)
WorldBuilder reset()
Optional<World> build() throws IllegalStateException
World
from the specified parameters.IllegalStateException
- If any required parameters are missingWorldCreationSettings buildSettings() throws IllegalStateException
WorldCreationSettings
which may be later
used to create a world.IllegalStateException
- If any required parameters are missing