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. By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user