diff --git a/core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java b/core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java index ddffac28..e2963eaa 100644 --- a/core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java +++ b/core/src/main/java/com/boydti/fawe/wrappers/WorldWrapper.java @@ -37,7 +37,14 @@ public class WorldWrapper extends AbstractWorld { private final AbstractWorld parent; - public WorldWrapper(AbstractWorld parent) { + public static WorldWrapper wrap(AbstractWorld world) { + if (world instanceof WorldWrapper) { + return (WorldWrapper) world; + } + return new WorldWrapper(world); + } + + private WorldWrapper(AbstractWorld parent) { this.parent = parent; } diff --git a/core/src/main/java/com/sk89q/worldedit/EditSession.java b/core/src/main/java/com/sk89q/worldedit/EditSession.java index 6a0e882b..b4cc2490 100644 --- a/core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -239,7 +239,7 @@ public class EditSession implements Extent { } // Wrap the world - this.world = (world instanceof WorldWrapper) ? world : (world = new WorldWrapper((AbstractWorld) world)); + this.world = (world = WorldWrapper.wrap((AbstractWorld) world)); // Delegate some methods to an implementation specific class this.wrapper = Fawe.imp().getEditSessionWrapper(this);