From 22b4d0adfbc799874348257ae144148f59ba6b48 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Wed, 15 Feb 2012 20:58:41 -0800 Subject: [PATCH] Updated for SpoutAPI entity changes --- .../com/sk89q/worldedit/spout/SpoutPlayer.java | 14 +++++++------- .../worldedit/spout/SpoutServerInterface.java | 3 ++- .../com/sk89q/worldedit/spout/WorldEditPlugin.java | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java b/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java index 7ffca58b0..72de1f2f7 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java @@ -59,19 +59,19 @@ public class SpoutPlayer extends LocalPlayer { @Override public WorldVector getPosition() { - Point loc = player.getEntity().getTransform().getPosition(); + Point loc = player.getEntity().getPoint(); return new WorldVector(SpoutUtil.getLocalWorld(loc.getWorld()), loc.getX(), loc.getY(), loc.getZ()); } @Override public double getPitch() { - return player.getEntity().getTransform().getRotation().getAxisAngles().getY(); + return player.getEntity().getPitch(); } @Override public double getYaw() { - return player.getEntity().getTransform().getRotation().getAxisAngles().getZ(); + return player.getEntity().getYaw(); } @Override @@ -109,9 +109,9 @@ public class SpoutPlayer extends LocalPlayer { @Override public void setPosition(Vector pos, float pitch, float yaw) { - Transform t = player.getEntity().getTransform(); - t.setPosition(new Point(t.getPosition().getWorld(), (float) pos.getX(), (float) pos.getY(), (float) pos.getZ())); - t.setRotation(new Quaternion(pitch, Vector3.UNIT_Z).rotate(yaw, Vector3.UNIT_Y)); + player.getEntity().setPoint((float)pos.getX(), (float)pos.getY(), (float)pos.getZ()); + player.getEntity().setPitch(pitch); + player.getEntity().setYaw(yaw); } @Override @@ -131,7 +131,7 @@ public class SpoutPlayer extends LocalPlayer { @Override public LocalWorld getWorld() { - return SpoutUtil.getLocalWorld(player.getEntity().getTransform().getPosition().getWorld()); + return SpoutUtil.getLocalWorld(player.getEntity().getPoint().getWorld()); } @Override diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutServerInterface.java b/src/main/java/com/sk89q/worldedit/spout/SpoutServerInterface.java index 3d82219cb..0600bf0d5 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutServerInterface.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutServerInterface.java @@ -81,7 +81,8 @@ public class SpoutServerInterface extends ServerInterface { public void onCommandRegistration(List commands) { for (Command command : commands) { Spout.getGame().getRootCommand().addSubCommand(plugin, command.aliases()[0]) - .addAlias(command.aliases()).setRawExecutor(executor).closeSubCommand(); + .addAlias(command.aliases()).setRawExecutor(executor). + setUsage(command.usage()).setHelp(command.desc()).closeSubCommand(); } } } diff --git a/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java b/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java index ab5bbfe06..8d52863c2 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().getTransform().getPosition().getWorld())); + RegionSelector selector = session.getRegionSelector(SpoutUtil.getLocalWorld(player.getEntity().getPoint().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().getTransform().getPosition().getWorld()), sel); + session.setRegionSelector(SpoutUtil.getLocalWorld(player.getEntity().getPoint().getWorld()), sel); session.dispatchCUISelection(wrapPlayer(player)); }