diff options
author | Wesley Wolfe <weswolf@aol.com> | 2013-08-07 04:05:56 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-08-07 04:05:56 -0500 |
commit | 92f111cfed5b067165a7ae147f2026884057801a (patch) | |
tree | 530c43ff0b4dbfb4c0192747461c45a6e4ecfc23 /src/main | |
parent | 0506b709fe9d325725a3ef1c758b7c9843dd7310 (diff) | |
download | craftbukkit-92f111cfed5b067165a7ae147f2026884057801a.tar craftbukkit-92f111cfed5b067165a7ae147f2026884057801a.tar.gz craftbukkit-92f111cfed5b067165a7ae147f2026884057801a.tar.lz craftbukkit-92f111cfed5b067165a7ae147f2026884057801a.tar.xz craftbukkit-92f111cfed5b067165a7ae147f2026884057801a.zip |
Fix missed diff for chat packets. Fixes BUKKIT-4666
This commit removes chat wrapping. It is no longer needed, as clients
properly render lines with line breaks.
This commit also changes an outgoing chat message to use the vanilla
behavior for indicating a client cannot chat with commands-only setting.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/PlayerConnection.java | 10 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/TextWrapper.java | 24 |
2 files changed, 1 insertions, 33 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index 6aa7a21b..6444a2f7 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -715,14 +715,6 @@ public class PlayerConnection extends Connection { if (i == 1 && !packet3chat.isServer()) { return; } - - // CraftBukkit start - String message = packet3chat.message; - for (final String line : org.bukkit.craftbukkit.TextWrapper.wrapText(message)) { - this.networkManager.queue(new Packet3Chat(line)); - } - return; - // CraftBukkit end } // CraftBukkit start @@ -830,7 +822,7 @@ public class PlayerConnection extends Connection { // CraftBukkit start if (this.player.getChatFlags() == 1 && !s.startsWith("/")) { - this.sendPacket(new Packet3Chat("Cannot send chat message.")); + this.sendPacket(new Packet3Chat(ChatMessage.e("chat.cannotSend").a(EnumChatFormat.RED))); return; } diff --git a/src/main/java/org/bukkit/craftbukkit/TextWrapper.java b/src/main/java/org/bukkit/craftbukkit/TextWrapper.java deleted file mode 100644 index 8c748205..00000000 --- a/src/main/java/org/bukkit/craftbukkit/TextWrapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.bukkit.craftbukkit; - -import java.util.ArrayList; -import java.util.List; -import org.bukkit.ChatColor; - -public class TextWrapper { - public static List<String> wrapText(final String text) { - ArrayList<String> output = new ArrayList<String>(); - String[] lines = text.split("\n"); - String lastColor = null; - - for (String line : lines) { - if (lastColor != null) { - line = lastColor + line; - } - - output.add(line); - lastColor = ChatColor.getLastColors(line); - } - - return output; - } -} |