From 0525112293a149a2d75691e81bdde3e2a269fe71 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Sat, 11 Feb 2012 13:59:42 -0800 Subject: [PATCH] Fixed /scriptname.js and no-double-slash settings not working --- CHANGELOG.txt | 25 ++++++++++--------- .../worldedit/bukkit/WorldEditListener.java | 14 ++++++++++- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0763ad7f0..67e9d555d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,16 +1,17 @@ 5.2: -- Made BlockBag use WorldVectors for add(Single)SourcePosition -- Fixed north face not being set with non-singleblockpatterns. -- Moved the block data check to LocalWorld, adding preliminary support for custom blocks. -- Lookup by id if the string passed to Block/ItemType.lookup() is an integer -- Fixed issues with //replace. -- Factored lookup code from BlockType and ItemType into a method in StringUtil. -- BaseBlock changes -- Properly escape cuipattern -- Fix handling of empty strings passed to Block/ItemType -- Improved formatting and performance of YAMLProcessor when no comments are present -- Added bPermissions support -- Update for new events system + - Made BlockBag use WorldVectors for add(Single)SourcePosition + - Fixed north face not being set with non-singleblockpatterns. + - Moved the block data check to LocalWorld, adding preliminary support for custom blocks. + - Lookup by id if the string passed to Block/ItemType.lookup() is an integer + - Fixed issues with //replace. + - Factored lookup code from BlockType and ItemType into a method in StringUtil. + - BaseBlock changes + - Properly escape cuipattern + - Fix handling of empty strings passed to Block/ItemType + - Improved formatting and performance of YAMLProcessor when no comments are present + - Added bPermissions support + - Update for new events system + - Fixed /scriptname.js and no-double-slash settings not working 5.1.1: - Fixed some compatibility issues with SpoutPlugin diff --git a/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java b/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java index 512172740..fda9e5f8c 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/WorldEditListener.java @@ -96,8 +96,20 @@ public class WorldEditListener implements Listener { split = plugin.getWorldEdit().commandDetection(split); split[0] = "/" + split[0]; } + + final String newMessage = StringUtil.joinString(split, " "); - event.setMessage(StringUtil.joinString(split, " ")); + if (!newMessage.equals(event.getMessage())) { + event.setMessage(newMessage); + plugin.getServer().getPluginManager().callEvent(event); + if (!event.isCancelled()) { + if (event.getMessage().length() > 0) { + plugin.getServer().dispatchCommand(event.getPlayer(), + event.getMessage().substring(1)); + } + event.setCancelled(true); + } + } } /**