Interface LevelStemEditor


@NullMarked @AsOf("2.3.0") @Experimental public interface LevelStemEditor
Modifies a loaded world's dimension type and/or chunk generator during runtime. Operations with this editor are transient, but you are advised to not use this on production servers.
Since:
2.3.0
See Also:
  • Method Details

    • create

      @AsOf("2.3.0") static LevelStemEditor create()
      Creates a new editor backed by the runtime reference-swap implementation.
      Returns:
      a new editor instance
      Since:
      2.3.0
    • chunkGenerator

      @AsOf("3.0.0") LevelStemEditor chunkGenerator(ChunkGenerator generator)
      Swaps the chunk generator on a given world.
      Parameters:
      generator - the chunk generator to swap in
      Returns:
      this editor instance
      Since:
      3.0.0
    • dimension

      @AsOf("3.0.0") LevelStemEditor dimension(Dimension dimensionType)
      Swaps the dimension type on a given world.
      Parameters:
      dimensionType - the dimension type to swap in
      Returns:
      this editor instance
      Since:
      3.0.0
    • apply

      @AsOf("2.3.0") LevelStemEditor apply(World world)
      Applies the queued edits to a given world.
      Parameters:
      world - the world to edit
      Since:
      2.3.0
    • restore

      @AsOf("3.0.0") LevelStemEditor restore(World world)
      Reverts a world previously edited by this editor, restoring its original dimension type and/or chunk generator state, and clears the corresponding snapshots.
      Parameters:
      world - the world to revert
      Returns:
      this editor instance
      Throws:
      IllegalStateException - if this editor never edited the given world
      Since:
      3.0.0