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