No editing while an edit world is saving; resolves #1029

This commit is contained in:
Daniel Saukel 2021-07-08 17:42:53 +02:00
parent dfed686982
commit f71faf9d7a
3 changed files with 3 additions and 1 deletions

View File

@ -597,6 +597,7 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI {
* @param loadingWorld if a world is being loaded
*/
public void setLoadingWorld(boolean loadingWorld) {
log("World loading is now " + (loadingWorld ? "LOCKED" : "UNLOCKED"));
this.loadingWorld = loadingWorld;
}

View File

@ -143,11 +143,13 @@ public class DEditPlayer extends DInstancePlayer implements EditPlayer {
reset(false);
if (unloadIfEmpty && !plugin.isLoadingWorld() && editWorld != null && editWorld.getPlayers().isEmpty()) {
plugin.setLoadingWorld(true);
editWorld.delete();
new ProgressBar(player, config.getEditInstanceRemovalDelay()) {
@Override
public void onFinish() {
MessageUtil.sendActionBarMessage(player, DMessage.CMD_SAVE_SUCCESS.getMessage());
plugin.setLoadingWorld(false);
}
}.send(plugin);
}

View File

@ -26,7 +26,6 @@ import de.erethon.dungeonsxl.api.player.EditPlayer;
import de.erethon.dungeonsxl.api.world.EditWorld;
import de.erethon.dungeonsxl.api.world.GameWorld;
import de.erethon.dungeonsxl.api.world.ResourceWorld;
import de.erethon.dungeonsxl.dungeon.DGame;
import de.erethon.dungeonsxl.util.commons.compatibility.Internals;
import de.erethon.dungeonsxl.util.commons.compatibility.Version;
import de.erethon.dungeonsxl.util.commons.misc.FileUtil;