mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2025-01-22 08:02:33 +01:00
Make use of Spigot's Bukkit#unloadWorld(World, false) fix
This commit is contained in:
parent
93c786301a
commit
83ad5e24d9
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package de.erethon.dungeonsxl.world;
|
||||
|
||||
import de.erethon.commons.compatibility.Version;
|
||||
import de.erethon.commons.misc.FileUtil;
|
||||
import de.erethon.dungeonsxl.DungeonsXL;
|
||||
import de.erethon.dungeonsxl.api.world.EditWorld;
|
||||
@ -119,7 +120,7 @@ public class DEditWorld extends DInstanceWorld implements EditWorld {
|
||||
FileUtil.copyDir(getFolder(), getResource().getFolder(), DungeonsXL.EXCLUDED_FILES);
|
||||
DResourceWorld.deleteUnusedFiles(getResource().getFolder());
|
||||
if (!save) {
|
||||
Bukkit.unloadWorld(getWorld(), true);
|
||||
Bukkit.unloadWorld(getWorld(), /* SPIGOT-5225 */ !Version.isAtLeast(Version.MC1_14_4));
|
||||
}
|
||||
|
||||
FileUtil.removeDir(getFolder());
|
||||
|
@ -19,6 +19,7 @@ package de.erethon.dungeonsxl.world;
|
||||
import de.erethon.caliburn.CaliburnAPI;
|
||||
import de.erethon.caliburn.item.ExItem;
|
||||
import de.erethon.caliburn.item.VanillaItem;
|
||||
import de.erethon.commons.compatibility.Version;
|
||||
import de.erethon.commons.misc.BlockUtil;
|
||||
import de.erethon.commons.misc.FileUtil;
|
||||
import de.erethon.dungeonsxl.DungeonsXL;
|
||||
@ -452,7 +453,7 @@ public class DGameWorld extends DInstanceWorld implements GameWorld {
|
||||
|
||||
kickAllPlayers();
|
||||
|
||||
Bukkit.unloadWorld(getWorld(), true);
|
||||
Bukkit.unloadWorld(getWorld(), /* SPIGOT-5225 */ !Version.isAtLeast(Version.MC1_14_4));
|
||||
FileUtil.removeDir(getFolder());
|
||||
plugin.getInstanceCache().remove(this);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
package de.erethon.dungeonsxl.world;
|
||||
|
||||
import de.erethon.commons.chat.MessageUtil;
|
||||
import de.erethon.commons.compatibility.Version;
|
||||
import de.erethon.commons.misc.FileUtil;
|
||||
import de.erethon.dungeonsxl.DungeonsXL;
|
||||
import de.erethon.dungeonsxl.api.dungeon.Dungeon;
|
||||
@ -182,7 +183,7 @@ public class DResourceWorld implements ResourceWorld {
|
||||
World world = Bukkit.getWorld(name);
|
||||
boolean removed = false;
|
||||
if (world != null && world.getPlayers().isEmpty()) {
|
||||
Bukkit.unloadWorld(name, false);
|
||||
Bukkit.unloadWorld(name, /* SPIGOT-5225 */ !Version.isAtLeast(Version.MC1_14_4));
|
||||
}
|
||||
if (world == null || world.getPlayers().isEmpty()) {
|
||||
removed = instanceFolder.delete();
|
||||
@ -316,7 +317,7 @@ public class DResourceWorld implements ResourceWorld {
|
||||
World world = rawCreator.createWorld();
|
||||
File worldFolder = new File(Bukkit.getWorldContainer(), ".raw");
|
||||
FileUtil.copyDir(worldFolder, RAW, DungeonsXL.EXCLUDED_FILES);
|
||||
Bukkit.unloadWorld(world, false);
|
||||
Bukkit.unloadWorld(world, /* SPIGOT-5225 */ !Version.isAtLeast(Version.MC1_14_4));
|
||||
FileUtil.removeDir(worldFolder);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user