Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Latest commit

 

History

History
15 lines (13 loc) · 651 Bytes

import-world.md

File metadata and controls

15 lines (13 loc) · 651 Bytes

You need three things to import a world: a world folder, a world name and a data source. Here's an example of how to import a world:

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

File worldDir = new File("my_world_foler");
String worldName = "my_world";
SlimeLoader loader = plugin.getLoader(SlimeLoader.MYSQL);

try {
    // Note that this method should be called asynchronously
    plugin.importWorld(worldDir, worldName, loader);
} catch (WorldAlreadyExistsException | InvalidWorldException | WorldLoadedException | WorldTooBigException | IOException ex) {
    /* Exception handling */
}