summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWesley Wolfe <weswolf@aol.com>2012-08-04 05:44:16 -0500
committerWesley Wolfe <weswolf@aol.com>2012-08-04 05:44:23 -0500
commita5da834258c68bfaef6bf9fc02e5786346661cee (patch)
tree28b5c1b7de1b2a19b952d951753ff35b77ffdcb3 /src
parent9bed5272d3a38c3ccdbb6d79c51c51a76c7e1971 (diff)
downloadcraftbukkit-a5da834258c68bfaef6bf9fc02e5786346661cee.tar
craftbukkit-a5da834258c68bfaef6bf9fc02e5786346661cee.tar.gz
craftbukkit-a5da834258c68bfaef6bf9fc02e5786346661cee.tar.lz
craftbukkit-a5da834258c68bfaef6bf9fc02e5786346661cee.tar.xz
craftbukkit-a5da834258c68bfaef6bf9fc02e5786346661cee.zip
Fix chat not being cancellable when not using deprecated API.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index e878ac8a..e1f3e582 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -810,21 +810,21 @@ public class NetServerHandler extends NetHandler {
}
}
- public boolean chat(String s, boolean async) {
+ public void chat(String s, boolean async) {
if (!this.player.dead) {
if (s.length() == 0) {
logger.warning(this.player.name + " tried to send an empty message");
- return false;
+ return;
}
if (getPlayer().isConversing()) {
getPlayer().acceptConversationInput(s);
- return true;
+ return;
}
if (s.startsWith("/")) {
this.handleCommand(s);
- return true;
+ return;
} else {
Player player = this.getPlayer();
AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet());
@@ -836,6 +836,10 @@ public class NetServerHandler extends NetHandler {
queueEvent.setCancelled(event.isCancelled());
minecraftServer.chatQueue.add(queueEvent);
} else {
+ if (event.isCancelled()) {
+ return;
+ }
+
s = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage());
minecraftServer.console.sendMessage(s);
if (((LazyPlayerSet) event.getRecipients()).isLazy()) {
@@ -856,7 +860,7 @@ public class NetServerHandler extends NetHandler {
}
}
- return false;
+ return;
}
// CraftBukkit end