From ffa2824c4d2d7d403c229114819d735b70163d48 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Sun, 29 Jan 2012 16:22:04 -0800 Subject: [PATCH] Properly escape cuipattern --- .../java/com/sk89q/worldedit/bukkit/WorldEditListener.java | 2 +- src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java b/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java index d1551ba38..512172740 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java @@ -47,7 +47,7 @@ public class WorldEditListener implements Listener { private WorldEditPlugin plugin; private boolean ignoreLeftClickAir = false; - private final static Pattern cuipattern = Pattern.compile("u00a74u00a75u00a73u00a74([^|]*)\\|?(.*)"); + private final static Pattern cuipattern = Pattern.compile("u00a74u00a75u00a73u00a74([^\\|]*)\\|?(.*)"); /** * Called when a player plays an animation, such as an arm swing diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java b/src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java index f4eeea8c5..7c5c92847 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java @@ -70,8 +70,7 @@ public class SpoutWorld extends LocalWorld { */ @Override public boolean setBlockType(Vector pt, int type) { - world.setBlockId(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ(), (short)type, WorldEditPlugin.getInstance()); - return world.getBlockId(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()) != type; + return world.setBlockId(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ(), (short)type, WorldEditPlugin.getInstance()); } /** @@ -95,9 +94,7 @@ public class SpoutWorld extends LocalWorld { */ @Override public boolean setTypeIdAndData(Vector pt, int type, int data) { - int origType = getBlockType(pt), origData = getBlockData(pt); - world.setBlockIdAndData(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ(), (short) type, (short) data, WorldEditPlugin.getInstance()); - return origType != type && origData != data; + return world.setBlockIdAndData(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ(), (short) type, (short) data, WorldEditPlugin.getInstance()); } /**