mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-02-16 12:31:59 +01:00
Add warning of player still in world while unloading
This commit is contained in:
parent
23b429940c
commit
94bcca914f
@ -669,12 +669,13 @@ public class WorldManager {
|
||||
unloadTracker.add(world.getName());
|
||||
if (!Bukkit.unloadWorld(world, save)) {
|
||||
// TODO: Localize this, maybe with MultiverseException
|
||||
if (!world.getPlayers().isEmpty()) {
|
||||
throw new Exception("There are still players in the world! Please use --remove-players flag to "
|
||||
+ "your command if wish to teleport all players out of the world.");
|
||||
}
|
||||
throw new Exception("Is this the default world? You can't unload the default world!");
|
||||
}
|
||||
Logging.fine("Bukkit unloaded world: " + world.getName());
|
||||
}).onFailure(exception -> {
|
||||
Logging.severe("Failed to unload bukkit world: " + world.getName());
|
||||
exception.printStackTrace();
|
||||
}).andFinally(() -> unloadTracker.remove(world.getName()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user