From a898d0df05c0218a8abcaf27d6516a1a6555749c Mon Sep 17 00:00:00 2001 From: FeuSalamander Date: Wed, 15 Mar 2023 15:47:27 +0100 Subject: [PATCH] fixed Luckperms --- src/main/java/me/feusalamander/vmessage/Listeners.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/feusalamander/vmessage/Listeners.java b/src/main/java/me/feusalamander/vmessage/Listeners.java index ecc9cee..f56e694 100644 --- a/src/main/java/me/feusalamander/vmessage/Listeners.java +++ b/src/main/java/me/feusalamander/vmessage/Listeners.java @@ -116,11 +116,13 @@ public final class Listeners { private String luckperms(String message, Player p) { User user = luckPermsAPI.getPlayerAdapter(Player.class).getUser(p); - if (message.contains("#prefix#")) { - message = message.replace("#prefix#", Objects.requireNonNull(user.getCachedData().getMetaData().getPrefix())); + String prefix = user.getCachedData().getMetaData().getPrefix(); + String suffix = user.getCachedData().getMetaData().getPrefix(); + if (message.contains("#prefix#")&&prefix != null) { + message = message.replace("#prefix#", prefix); } - if (message.contains("#suffix#")) { - message = message.replace("#suffix#", Objects.requireNonNull(user.getCachedData().getMetaData().getSuffix())); + if (message.contains("#suffix#")&&suffix != null) { + message = message.replace("#suffix#", suffix); } return message; }