From fb78b9a5d855d7494acf5e6aaef70fe9a3e81e33 Mon Sep 17 00:00:00 2001 From: FeuSalamander Date: Sat, 18 Mar 2023 09:21:38 +0100 Subject: [PATCH] test --- .../me/feusalamander/vmessage/Listeners.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/feusalamander/vmessage/Listeners.java b/src/main/java/me/feusalamander/vmessage/Listeners.java index 5b1a47e..492339c 100644 --- a/src/main/java/me/feusalamander/vmessage/Listeners.java +++ b/src/main/java/me/feusalamander/vmessage/Listeners.java @@ -8,8 +8,6 @@ import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.server.RegisteredServer; -import net.kyori.adventure.chat.ChatType; -import net.kyori.adventure.chat.SignedMessage; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; @@ -19,6 +17,7 @@ import net.luckperms.api.model.user.User; import java.util.Objects; import java.util.Optional; +import java.util.SortedMap; public final class Listeners { public static final LegacyComponentSerializer SERIALIZER = LegacyComponentSerializer.builder() @@ -118,14 +117,23 @@ public final class Listeners { private String luckperms(String message, Player p) { User user = luckPermsAPI.getPlayerAdapter(Player.class).getUser(p); - String prefix = user.getCachedData().getMetaData().getPrefix(); - String suffix = user.getCachedData().getMetaData().getPrefix(); - if (message.contains("#prefix#")&&prefix != null) { + SortedMap prefixes = user.getCachedData().getMetaData().getPrefixes(); + SortedMap suffixes = user.getCachedData().getMetaData().getSuffixes(); + if (message.contains("#prefix#")&&prefixes.size()>0) { + String prefix = ""; + for(int i = 0; i0) { + String suffix = ""; + for(int i = 0; i