Archived
0

Fixed color permissions being ignored

This commit is contained in:
Nemes 2017-10-04 14:14:38 +02:00 committed by GitHub
parent 83f735c74d
commit 1fecee13ed

View File

@ -61,15 +61,15 @@ public class ChatAPI {
*/ */
public static String colorify(CommandSender sender, String message) { public static String colorify(CommandSender sender, String message) {
if (sender == null || sender.hasPermission(PERMISSION_CHAT_COLOR)) { if (sender == null || sender.hasPermission(PERMISSION_CHAT_COLOR)) {
message = message.replaceAll("&([0-9a-fA-FrR])", "§$1"); message = message.replaceAll("&([0-9a-fA-FrR])", "§$1");
} }
if (sender == null || sender.hasPermission(PERMISSION_CHAT_FORMAT)) { if (sender == null || sender.hasPermission(PERMISSION_CHAT_FORMAT)) {
message = message.replaceAll("&([l-oL-OrR])", "§$1"); message = message.replaceAll("&([l-oL-OrR])", "§$1");
} }
if (sender == null || sender.hasPermission(PERMISSION_CHAT_MAGIC)) { if (sender == null || sender.hasPermission(PERMISSION_CHAT_MAGIC)) {
message = message.replaceAll("&([kKrR])", "§$1"); message = message.replaceAll("&([kKrR])", "§$1");
} }
return message.replaceAll("", "&"); return message;
} }
/** /**