From 7f7178957aa764525b214bf9915b41d198f8383c Mon Sep 17 00:00:00 2001 From: zml2008 Date: Sat, 17 Mar 2012 15:17:49 -0700 Subject: [PATCH] Whitespace fixes, reactivated command adjustments --- src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java | 9 +++++---- .../sk89q/worldedit/spout/WorldEditPlayerListener.java | 9 +++++++-- .../java/com/sk89q/worldedit/spout/WorldEditPlugin.java | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java b/src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java index a07028796..13d7c2c64 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java @@ -29,6 +29,7 @@ import org.spout.api.geo.World; import org.spout.api.geo.cuboid.Block; import org.spout.api.geo.discrete.Point; import org.spout.api.material.block.BlockFace; +import org.spout.api.math.MathHelper; import org.spout.api.math.Vector3; import org.spout.api.player.Player; @@ -57,7 +58,7 @@ public class SpoutUtil { public static BlockVector toVector(BlockFace face) { return toBlockVector(face.getOffset()); } - + public static BlockVector toBlockVector(Vector3 vector) { return new BlockVector(vector.getX(), vector.getY(), vector.getZ()); } @@ -85,9 +86,9 @@ public class SpoutUtil { public static Point center(Point loc) { return new Point( loc.getWorld(), - loc.getX() + 0.5F, - loc.getY() + 0.5F, - loc.getZ() + 0.5F + MathHelper.floor(loc.getX()) + 0.5F, + MathHelper.floor(loc.getY()) + 0.5F, + MathHelper.floor(loc.getZ()) + 0.5F ); } diff --git a/src/main/java/com/sk89q/worldedit/spout/WorldEditPlayerListener.java b/src/main/java/com/sk89q/worldedit/spout/WorldEditPlayerListener.java index 579d210e6..0a00975fa 100644 --- a/src/main/java/com/sk89q/worldedit/spout/WorldEditPlayerListener.java +++ b/src/main/java/com/sk89q/worldedit/spout/WorldEditPlayerListener.java @@ -54,7 +54,7 @@ public class WorldEditPlayerListener implements Listener { /** * Construct the object; - * + * * @param plugin */ public WorldEditPlayerListener(WorldEditPlugin plugin) { @@ -81,9 +81,14 @@ public class WorldEditPlayerListener implements Listener { * * @param event Relevant event details */ - //@EventHandler(order = Order.EARLY) + @EventHandler(order = Order.EARLY) public void onPlayerCommandPreprocess(PreCommandEvent event) { + if (event.getMessage().startsWith("nowe:")) { + event.setMessage(event.getMessage().substring(5)); + return; + } + String[] split = event.getMessage().split(" "); if (split.length > 0) { diff --git a/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java b/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java index 6dbe70ee1..b9a44edf5 100644 --- a/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java +++ b/src/main/java/com/sk89q/worldedit/spout/WorldEditPlugin.java @@ -43,7 +43,7 @@ import java.util.zip.ZipEntry; /** * Plugin for Spout. - * + * * @author sk89q */ public class WorldEditPlugin extends CommonPlugin implements Named { @@ -331,7 +331,7 @@ public class WorldEditPlugin extends CommonPlugin implements Named { /** * Sets the region selection for a player. - * + * * @param player * @param selection */