summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();