diff --git a/bukkit0/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncWorld.java b/bukkit0/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncWorld.java index 72c85699..9aa35fce 100644 --- a/bukkit0/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncWorld.java +++ b/bukkit0/src/main/java/com/boydti/fawe/bukkit/wrapper/AsyncWorld.java @@ -120,6 +120,7 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue flush(); this.parent = world; this.queue = queue; + setParent(queue); } public World getBukkitWorld() { diff --git a/core/src/main/java/com/boydti/fawe/object/FaweQueue.java b/core/src/main/java/com/boydti/fawe/object/FaweQueue.java index a19d2bba..29acb211 100644 --- a/core/src/main/java/com/boydti/fawe/object/FaweQueue.java +++ b/core/src/main/java/com/boydti/fawe/object/FaweQueue.java @@ -29,7 +29,7 @@ import java.util.concurrent.ExecutorCompletionService; public abstract class FaweQueue { private World weWorld; - private final String world; + private String world; private ConcurrentLinkedDeque sessions; private long modified = System.currentTimeMillis(); private RunnableVal2 changeTask; @@ -40,8 +40,10 @@ public abstract class FaweQueue { } public FaweQueue(World world) { - this.weWorld = world; - this.world = Fawe.imp().getWorldName(world); + if (world != null) { + this.weWorld = world; + this.world = Fawe.imp().getWorldName(world); + } } public enum ProgressType { @@ -56,6 +58,11 @@ public abstract class FaweQueue { ALL, } + public void setWorld(String world) { + this.world = world; + this.weWorld = null; + } + public void addEditSession(EditSession session) { if (session == null) { return; diff --git a/core/src/main/java/com/boydti/fawe/util/DelegateFaweQueue.java b/core/src/main/java/com/boydti/fawe/util/DelegateFaweQueue.java index 71f5bfa6..b59c7eb2 100644 --- a/core/src/main/java/com/boydti/fawe/util/DelegateFaweQueue.java +++ b/core/src/main/java/com/boydti/fawe/util/DelegateFaweQueue.java @@ -18,7 +18,7 @@ public class DelegateFaweQueue extends FaweQueue { private FaweQueue parent; public DelegateFaweQueue(FaweQueue parent) { - super(parent.getWEWorld()); + super(parent == null ? null : parent.getWEWorld()); this.parent = parent; } @@ -28,6 +28,7 @@ public class DelegateFaweQueue extends FaweQueue { public void setParent(FaweQueue parent) { this.parent = parent; + setWorld(parent.getWorldName()); } @Override