From 5bdc2d65192a130e4418413b79a793def9c25bef Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 14 Apr 2018 02:23:31 +1000 Subject: [PATCH] Fixes #970 --- core/src/main/java/com/sk89q/worldedit/LocalSession.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/sk89q/worldedit/LocalSession.java b/core/src/main/java/com/sk89q/worldedit/LocalSession.java index b7938f9a..0fa32e6a 100644 --- a/core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -721,13 +721,15 @@ public class LocalSession { return selector.getRegion(); } - public synchronized @Nullable VirtualWorld getVirtualWorld() { - return virtual; + public @Nullable VirtualWorld getVirtualWorld() { + synchronized (dirty) { + return virtual; + } } public void setVirtualWorld(@Nullable VirtualWorld world) { VirtualWorld tmp; - synchronized (this) { + synchronized (dirty) { tmp = this.virtual; this.virtual = world; }