Added missing permission check for color replacement in chat

This commit is contained in:
Norbi Peti 2016-03-11 15:30:03 +01:00
parent 91a1cbcbdc
commit 80c0756ef7
3 changed files with 4 additions and 4 deletions

Binary file not shown.

View file

@ -70,7 +70,8 @@ public class ChatProcessing {
// slashes
// first
formattedmessage = formattedmessage.replace("\"", "\\\"");
formattedmessage = formattedmessage.replace("&", "§");
if (PluginMain.permission.has(sender, "tbmc.admin"))
formattedmessage = formattedmessage.replace("&", "§");
formattedmessage = formattedmessage.replace("§r", "§"
+ currentchannel.DisplayName.charAt(1));
String suggestmsg = formattedmessage;
@ -213,9 +214,8 @@ public class ChatProcessing {
json.append("[\"\",");
json.append(String
.format("{\"text\":\"[%s]%s\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"Copy message\",\"color\":\"blue\"}},clickEvent:{\"action\":\"suggest_command\",\"value\":\"%s\"}},",
currentchannel.DisplayName,
(mplayer != null && !mplayer.RPMode ? "[OOC]" : ""),
suggestmsg));
currentchannel.DisplayName, (mplayer != null
&& !mplayer.RPMode ? "[OOC]" : ""), suggestmsg));
json.append("{\"text\":\" <\"},");
json.append(String.format("{\"text\":\"%s%s\",",
(player != null ? player.getDisplayName() : sender.getName()),