summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorsk89q <the.sk89q@gmail.com>2011-02-19 01:40:32 -0800
committersk89q <the.sk89q@gmail.com>2011-02-19 18:02:13 -0800
commitd4b67c5549dec7c27b39a27c81299e218b79826f (patch)
tree75fd1d22471669d4937c1972b0f3c36ec2aa8851 /src/main/java/net
parentacd034445239325d60c3211ed71ee5e71c997ce0 (diff)
downloadcraftbukkit-d4b67c5549dec7c27b39a27c81299e218b79826f.tar
craftbukkit-d4b67c5549dec7c27b39a27c81299e218b79826f.tar.gz
craftbukkit-d4b67c5549dec7c27b39a27c81299e218b79826f.tar.lz
craftbukkit-d4b67c5549dec7c27b39a27c81299e218b79826f.tar.xz
craftbukkit-d4b67c5549dec7c27b39a27c81299e218b79826f.zip
Lowered the priority of the old command handler event. A number of plugins were using this event incorrectly. A new event, the command preprocesser event, has replaced the previous function of the original command event.
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index bca70f50..ebd28b2b 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -622,7 +622,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
// CraftBukkit start
CraftPlayer player = getPlayer();
- PlayerChatEvent event = new PlayerChatEvent(Type.PLAYER_COMMAND, player, s);
+ PlayerChatEvent event = new PlayerChatEvent(Type.PLAYER_COMMAND_PREPROCESS, player, s);
server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
@@ -641,6 +641,14 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
if (targetPluginFound) {
return;
}
+
+ // Legacy command handler
+ event = new PlayerChatEvent(Type.PLAYER_COMMAND, player, s);
+ server.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return;
+ }
+
s = event.getMessage();
player = (CraftPlayer) event.getPlayer();
EntityPlayer e = player.getHandle();