vault might not exist, fix that

This commit is contained in:
yourfriendoss 2024-04-01 10:50:12 +03:00
parent 8b33abd7e2
commit 988a5e2006

View file

@ -56,9 +56,13 @@ public class PlayerChat implements Listener {
String format = "%prefix%teamColor%animalColor%name%suffix: %message";
String message = format;
if(AnimalRP.vaultChat != null) {
message = message.replaceAll("%prefix", AnimalRP.vaultChat.getPlayerPrefix(event.getPlayer()));
message = message.replaceAll("%suffix", AnimalRP.vaultChat.getPlayerSuffix(event.getPlayer()));
} else {
message = message.replaceAll("%prefix", "");
message = message.replaceAll("%suffix", "");
}
message = message.replaceAll("%teamColor", team == null ? "" : "<" + team.color().asHexString() + ">");
message = message.replaceAll("%animalColor", (animal != null && !chatModOff) ? "<" + animal.color + ">" : "");
message = message.replaceAll("%name", event.getPlayer().getName());