From c88583c1c09885d8f4dce5a95e0b6c9326889a43 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sun, 8 Dec 2013 17:07:45 +0100 Subject: [PATCH] Use Matcher.quoteReplacement here! Fixes #1676 - for real this time --- src/main/java/com/gmail/nossr50/chat/PartyChatManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java b/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java index 16d4a2620..6279e409a 100644 --- a/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java +++ b/src/main/java/com/gmail/nossr50/chat/PartyChatManager.java @@ -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()) {