Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Latest commit

 

History

History
17 lines (14 loc) · 715 Bytes

File metadata and controls

17 lines (14 loc) · 715 Bytes

To migrate a world you need three things: a world name, the data source where the world is currently stored in and another data source to store the world. Here's an example of a world migration:

SlimePlugin plugin = (SlimePlugin) Bukkit.getPluginManager().getPlugin("SlimeWorldManager");

String worldName = "my_world";
SlimeLoader currentLoader = plugin.getLoader("mysql");
SlimeLoader newLoader = plugin.getLoader("mongodb");

try {
    // Note that this method should be called asynchronously
    plugin.migrateWorld(worldName, currentLoader, newLoader);
} catch (IOException | WorldInUseException | WorldAlreadyExistsException | UnknownWorldException ex) {
    /* Exception handling */
}

That's it!