Class WorldBuilder

java.lang.Object
fr.fidorial.world.WorldBuilder

public class WorldBuilder extends Object
  • Method Details

    • builder

      @Contract(value="_ -> new", pure=true) public static WorldBuilder.Builder builder(Key key)
      Creates a new builder for a world identified by the given key.
      Parameters:
      key - the namespaced identifier of the world to create; also used as its world key
      Returns:
      a fresh builder
      Since:
      0.1.0
    • key

      @Contract(pure=true) public Key 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 through Server.world(Key).

      Returns:
      the world key
      Since:
      0.1.0
    • seed

      @Contract(pure=true) public long seed()
      Returns the world seed.
      Returns:
      the world seed, or 0 when none was set
      Since:
      0.1.0
    • generator

      @Contract(pure=true) public Optional<WorldGenerator> 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

      @Contract(value="-> new", pure=true) public WorldBuilder.Builder 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
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object