Skip to content

ModLabsCC/WorldEngine

Repository files navigation


Logo

WorldEngine

WorldManagement kept ahead of the curve, always planning a step further.

Website · Contact

Compatibility

  • Paper 26.2
  • Java 25
  • KPaper lifecycle with all optional KPaper features disabled

Jenkins builds with the jdk25 tool and exposes the successful JAR as a downloadable build artifact.

PlotSquared compatibility

Use PlotSquared's normal /plot setup workflow and keep PlotSquared selected as the generator. PlotSquared creates the Bukkit world; WorldEngine discovers the loaded world automatically and manages it through /world <name> and the WorldEngine API.

WorldEngine intentionally does not register itself as a /plot setup generator.

API usage

WorldEngine exposes a small Bukkit service API for other plugins:

  • Service interface: cc.modlabs.worldengine.api.WorldEngineApi
  • Convenience accessor: cc.modlabs.worldengine.WorldEngine.api

Kotlin example

import cc.modlabs.worldengine.WorldEngine

val worldEngine = Bukkit.getPluginManager().getPlugin("WorldEngine") as? WorldEngine
    ?: return
val api = worldEngine.api

// Load or create world (same behavior as /world <name>)
val world = api.getOrLoadWorld("event_world") ?: return

// Teleport player to world spawn
api.teleportToWorldSpawn(player, world)

// Create world with a preset generator
val flatGenerator = api.resolveChunkGenerator("flat")
api.createWorld("flat_event", flatGenerator)

// Copy world asynchronously-ish on main thread callback
api.scheduleWorldCopy(world, "event_world_backup") { result ->
    result.onSuccess { copied ->
        player.sendMessage("Copied world: ${copied.name}")
    }.onFailure { error ->
        player.sendMessage("Copy failed: ${error.message}")
    }
}

Java example

import cc.modlabs.worldengine.api.WorldEngineApi;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;

RegisteredServiceProvider<WorldEngineApi> registration =
        Bukkit.getServicesManager().getRegistration(WorldEngineApi.class);
if (registration == null) {
    return;
}

WorldEngineApi api = registration.getProvider();
var world = api.getOrLoadWorld("event_world");
if (world != null) {
    api.teleportToWorldSpawn(player, world);
}

Notes

  • API methods are designed to mirror existing command/startup features.
  • Permission enforcement is not automatic for API callers; handle authorization in your plugin.
  • Built-in generator ids are empty, flat, and ocean.

Dependency (for plugin developers)

WorldEngine is published to ModLabs Nexus.

Gradle Kotlin DSL (build.gradle.kts)

repositories {
    maven("https://repo-api.modlabs.cc/repo/maven/maven-mirror/")
}

dependencies {
    compileOnly("cc.modlabs.worldengine:WorldEngine:<version>")
}

About

WorldManagement kept ahead of the curve, always planning a step further

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Contributors

Languages