Fixed nicknames if only 1 player is on

Also added a town colors component class
This commit is contained in:
Norbi Peti 2018-12-28 00:55:32 +01:00
parent 12072f3106
commit 99a8c1b020
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
2 changed files with 26 additions and 3 deletions

View file

@ -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++;
}

View file

@ -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<Byte> colorCount() { //TODO
return getData("colorCount", (byte) 1, cc -> (byte) cc, cc -> (int) cc);
}
public ConfigData<Boolean> useNationColors() { //TODO
return getData("useNationColors", true);
}
@Override
protected void enable() {
//TODO: Don't register all commands automatically (welp)
}
@Override
protected void disable() {
}
}