Use Matcher.quoteReplacement here!

Fixes #1676 - for real this time
This commit is contained in:
TfT_02 2013-12-08 17:07:45 +01:00
parent d2b6838453
commit c88583c1c0

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.chat;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.bukkit.ChatColor;
@ -29,7 +30,7 @@ public class PartyChatManager extends ChatManager {
@Override
protected void sendMessage() {
if (Config.getInstance().getPartyChatColorLeaderName() && senderName.equalsIgnoreCase(party.getLeader())) {
message = message.replaceFirst(Pattern.quote(displayName), ChatColor.GOLD + Pattern.quote(displayName) + ChatColor.RESET);
message = message.replaceFirst(Pattern.quote(displayName), ChatColor.GOLD + Matcher.quoteReplacement(displayName) + ChatColor.RESET);
}
for (Player member : party.getOnlineMembers()) {