From 63f7106000b2ab00b0cabab074e40e46ddee0faa Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 17 Dec 2016 15:03:53 -0500 Subject: [PATCH] attempted fix, ChatProcessing line 125-136 I believe the previous code was creating unbalanced parenthesis --- .../java/buttondevteam/chat/ChatProcessing.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/buttondevteam/chat/ChatProcessing.java b/src/main/java/buttondevteam/chat/ChatProcessing.java index 4ff2106..41f0596 100644 --- a/src/main/java/buttondevteam/chat/ChatProcessing.java +++ b/src/main/java/buttondevteam/chat/ChatProcessing.java @@ -122,12 +122,19 @@ public class ChatProcessing { namesb.append(")"); StringBuilder nicksb = new StringBuilder(); nicksb.append("(?i)("); - for (Player p : PluginMain.GetPlayers()) { - final String nick = PlayerListener.nicknames.inverse().get(p.getUniqueId()); - if (nick != null) // Not everyone has a nickname - nicksb.append(nick).append("|"); + final int size = PluginMain.GetPlayers().size(); + for (int i = 0; i < size; i++) + { + final String nick = PlayerListener.nicknames.inverse().get(p.getUniqueId()); + if (nick != null) + { + nicksb.append(nick); + if (i < size - 1) + { + nicksb.append("|") + } + } } - nicksb.deleteCharAt(nicksb.length() - 1); nicksb.append(")"); formatters