Class WorldSpec
java.lang.Object
fr.fidorial.world.WorldSpec
An immutable description of a world to create through
Server.createWorld(WorldSpec).
Instances are obtained from builder(Key); toBuilder() derives a modified copy.
- Since:
- 0.1.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic WorldSpec.BuilderCreates a new builder for a world identified by the given key.booleanReturns the custom chunk generator for the world, if one was supplied.inthashCode()key()Returns the namespaced identifier of the world.longseed()Returns the world seed.Returns a builder pre-populated with the values of this spec, so a modified copy can be derived without mutating the original.
-
Method Details
-
builder
-
key
Returns the namespaced identifier of the world.This is the value that will be exposed as
Keyed.key()once the world exists and the value used to look the world up again throughServer.world(Key).- Returns:
- the world key
- Since:
- 0.1.0
-
seed
-
generator
Returns the custom chunk generator for the world, if one was supplied.When empty, the server falls back to its built-in default generator.
- Returns:
- the generator, or an empty optional to use the server default
- Since:
- 0.1.0
-
toBuilder
Returns a builder pre-populated with the values of this spec, so a modified copy can be derived without mutating the original.- Returns:
- a builder seeded with this spec's values
- Since:
- 0.1.0
-
equals
-
hashCode
-