From 99a8c1b02027af0b59dc9b1687bf04099718ce6c Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 28 Dec 2018 00:55:32 +0100 Subject: [PATCH] Fixed nicknames if only 1 player is on Also added a town colors component class --- .../buttondevteam/chat/ChatProcessing.java | 5 ++-- .../chat/components/TownColorComponent.java | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 src/main/java/buttondevteam/chat/components/TownColorComponent.java diff --git a/src/main/java/buttondevteam/chat/ChatProcessing.java b/src/main/java/buttondevteam/chat/ChatProcessing.java index 02fe85c..e9e65be 100644 --- a/src/main/java/buttondevteam/chat/ChatProcessing.java +++ b/src/main/java/buttondevteam/chat/ChatProcessing.java @@ -263,10 +263,9 @@ public class ChatProcessing { final String nick = PlayerListener.nicknames.inverse().get(p.getUniqueId()); if (nick != null) { nicksb.append(nick); - if (index < size - 1) { + if (index < size - 1) nicksb.append("|"); - addNickFormatter = true; - } + addNickFormatter = true; //Add it even if there's only 1 player online (it was in the if) } index++; } diff --git a/src/main/java/buttondevteam/chat/components/TownColorComponent.java b/src/main/java/buttondevteam/chat/components/TownColorComponent.java new file mode 100644 index 0000000..b731ea7 --- /dev/null +++ b/src/main/java/buttondevteam/chat/components/TownColorComponent.java @@ -0,0 +1,24 @@ +package buttondevteam.chat.components; + +import buttondevteam.lib.architecture.Component; +import buttondevteam.lib.architecture.ConfigData; + +public class TownColorComponent extends Component { + public ConfigData colorCount() { //TODO + return getData("colorCount", (byte) 1, cc -> (byte) cc, cc -> (int) cc); + } + + public ConfigData useNationColors() { //TODO + return getData("useNationColors", true); + } + + @Override + protected void enable() { + //TODO: Don't register all commands automatically (welp) + } + + @Override + protected void disable() { + + } +}