WorldManager

interface WorldManager

The world manager for this server. Can be used to retrieve loaded worlds, or to load, save and update existing worlds.

Functions

Link copied to clipboard
abstract fun getWorld(key: Key): World?

Gets the loaded world with the given resource key, or null if there is no world loaded with the given resource key.

Link copied to clipboard
abstract fun isLoaded(key: Key): Boolean

Checks if there is currently a world loaded with the given key.

Link copied to clipboard
abstract fun loadWorld(key: Key): CompletableFuture<out World?>

Loads a world by its resource key, if there is a world that can be loaded from the given key.

Link copied to clipboard
abstract fun saveWorld(world: World): CompletableFuture<Void>

Saves the given world to disk.

Properties

Link copied to clipboard
abstract val default: World

The default world for this server.

Link copied to clipboard
abstract val server: Server

The server this world manager is bound to.

Link copied to clipboard
abstract val worlds: Map<ResourceKey<World>, World>

The map of all currently loaded worlds by dimension.