No editing while an edit world is saving; resolves #1029
This commit is contained in:
parent
dfed686982
commit
f71faf9d7a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue