Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 715 Bytes

migrate-world.md

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!