SPIGOT-5225: World handle isn't closed if world is unloaded without saving

This commit is contained in:
md_5
2019-07-29 16:36:51 +10:00
parent 104b3831f8
commit da62a66ab7
2 changed files with 24 additions and 9 deletions

View File

@@ -981,13 +981,14 @@ public final class CraftServer implements Server {
return false;
}
if (save) {
try {
try {
if (save) {
handle.save(null, true, true);
handle.close();
} catch (Exception ex) {
getLogger().log(Level.SEVERE, null, ex);
}
handle.getChunkProvider().close(save);
} catch (Exception ex) {
getLogger().log(Level.SEVERE, null, ex);
}
worlds.remove(world.getName().toLowerCase(java.util.Locale.ENGLISH));