From b8e9f6bb77e7dba8215d12885d99030b9bfa8d14 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Mon, 12 Mar 2012 07:51:44 +0100 Subject: [PATCH] Updated to new SpoutAPI version. --- .../java/com/sk89q/worldedit/spout/SpoutPlayer.java | 13 ++++++++----- .../com/sk89q/worldedit/spout/WorldEditPlugin.java | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java b/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java index 5ae0c3ef6..088598b2b 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java @@ -27,6 +27,8 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.bags.BlockBag; import com.sk89q.worldedit.cui.CUIEvent; + +import org.spout.api.entity.Entity; import org.spout.api.geo.discrete.Point; import org.spout.api.inventory.ItemStack; import org.spout.api.material.MaterialData; @@ -56,7 +58,7 @@ public class SpoutPlayer extends LocalPlayer { @Override public WorldVector getPosition() { - Point loc = player.getEntity().getPoint(); + Point loc = player.getEntity().getPosition(); return new WorldVector(SpoutUtil.getLocalWorld(loc.getWorld()), loc.getX(), loc.getY(), loc.getZ()); } @@ -106,9 +108,10 @@ public class SpoutPlayer extends LocalPlayer { @Override public void setPosition(Vector pos, float pitch, float yaw) { - player.getEntity().setPoint((float)pos.getX(), (float)pos.getY(), (float)pos.getZ()); - player.getEntity().setPitch(pitch); - player.getEntity().setYaw(yaw); + final Entity entity = player.getEntity(); + entity.setPosition(SpoutUtil.toPoint(entity.getWorld(), pos)); + entity.setPitch(pitch); + entity.setYaw(yaw); } @Override @@ -128,7 +131,7 @@ public class SpoutPlayer extends LocalPlayer { @Override public LocalWorld getWorld() { - return SpoutUtil.getLocalWorld(player.getEntity().getPoint().getWorld()); + return SpoutUtil.getLocalWorld(player.getEntity().getWorld()); } @Override diff --git a/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java b/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java index 8d52863c2..6dbe70ee1 100644 --- a/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java +++ b/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java @@ -311,7 +311,7 @@ public class WorldEditPlugin extends CommonPlugin implements Named { } LocalSession session = controller.getSession(wrapPlayer(player)); - RegionSelector selector = session.getRegionSelector(SpoutUtil.getLocalWorld(player.getEntity().getPoint().getWorld())); + RegionSelector selector = session.getRegionSelector(SpoutUtil.getLocalWorld(player.getEntity().getWorld())); try { Region region = selector.getRegion(); @@ -348,7 +348,7 @@ public class WorldEditPlugin extends CommonPlugin implements Named { LocalSession session = controller.getSession(wrapPlayer(player)); RegionSelector sel = selection.getRegionSelector(); - session.setRegionSelector(SpoutUtil.getLocalWorld(player.getEntity().getPoint().getWorld()), sel); + session.setRegionSelector(SpoutUtil.getLocalWorld(player.getEntity().getWorld()), sel); session.dispatchCUISelection(wrapPlayer(player)); }