From 1c902bfad326a83279d38898b345c7f7836bf80d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 29 Oct 2016 22:01:55 +1100 Subject: [PATCH] Adapt ForgeWorld to LocalWorld for LocationMaskedPlayerWrapper --- .../fawe/wrappers/LocationMaskedPlayerWrapper.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/boydti/fawe/wrappers/LocationMaskedPlayerWrapper.java b/core/src/main/java/com/boydti/fawe/wrappers/LocationMaskedPlayerWrapper.java index a4c5d76a..7d507723 100644 --- a/core/src/main/java/com/boydti/fawe/wrappers/LocationMaskedPlayerWrapper.java +++ b/core/src/main/java/com/boydti/fawe/wrappers/LocationMaskedPlayerWrapper.java @@ -4,7 +4,9 @@ import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.internal.LocalWorldAdapter; import com.sk89q.worldedit.util.Location; +import com.sk89q.worldedit.world.World; public class LocationMaskedPlayerWrapper extends PlayerWrapper { private Location position; @@ -38,7 +40,13 @@ public class LocationMaskedPlayerWrapper extends PlayerWrapper { @Override public WorldVector getPosition() { - return new WorldVector((LocalWorld) position.getExtent(), position.toVector()); + LocalWorld world; + if (position.getExtent() instanceof LocalWorld) { + world = (LocalWorld) position.getExtent(); + } else { + world = LocalWorldAdapter.adapt((World) position.getExtent()); + } + return new WorldVector(world, position.toVector()); } @Override