Added a workaround for the issue...
Just realized that the match itself is null
This commit is contained in:
parent
a09a30d460
commit
845f3e1f16
2 changed files with 6 additions and 5 deletions
|
@ -147,8 +147,6 @@ public class ChatProcessing {
|
|||
|
||||
formatters.add(new ChatFormatterBuilder().setRegex(Pattern.compile(nicksb.toString())).setColor(Color.Aqua)
|
||||
.setOnmatch((String match) -> {
|
||||
System.out.println("Match: " + match);
|
||||
System.out.println("A nickname: " + PlayerListener.nicknames.keySet().stream().findAny());
|
||||
if (PlayerListener.nicknames.containsKey(match)) {
|
||||
Player p = Bukkit.getPlayer(PlayerListener.nicknames.get(match));
|
||||
if (p == null) {
|
||||
|
|
|
@ -164,12 +164,15 @@ public final class ChatFormatter {
|
|||
section.Formatters.sort((cf2, cf1) -> cf1.priority.compareTo(cf2.priority));
|
||||
for (ChatFormatter formatter : section.Formatters) {
|
||||
DebugCommand.SendDebugMessage("Applying formatter: " + formatter);
|
||||
if (formatter.onmatch != null)
|
||||
originaltext = formatter.onmatch.apply(originaltext);
|
||||
if (formatter.onmatch != null) {
|
||||
String f = formatter.onmatch.apply(originaltext);
|
||||
if (f != null)
|
||||
originaltext = f; //TODO: Find out...
|
||||
}
|
||||
if (formatter.color != null)
|
||||
color = formatter.color;
|
||||
if (formatter.format != null)
|
||||
format = formatter.format.getFlag(); //TODO: Fix
|
||||
format = formatter.format.getFlag(); // TODO: Fix
|
||||
if (formatter.openlink != null)
|
||||
openlink = formatter.openlink;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue