diff --git a/src/de/steamwar/bungeecore/commands/WhoisCommand.java b/src/de/steamwar/bungeecore/commands/WhoisCommand.java index b020b2e1..1690f547 100644 --- a/src/de/steamwar/bungeecore/commands/WhoisCommand.java +++ b/src/de/steamwar/bungeecore/commands/WhoisCommand.java @@ -107,7 +107,7 @@ public class WhoisCommand extends SWCommand { if(!user.getActiveMods().isEmpty()) { Message.send("WHOIS_ACTIVE_MODS",player); for(Mod mod : user.getActiveMods()) { - Message.sendPrefixless("WHOIS_ACTIVE_MOD", player,mod.getModName()); + Message.send("WHOIS_ACTIVE_MOD", player,mod.getModName()); } }else { Message.send("WHOIS_NO_ACTIVE_MODS",player); diff --git a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java index 6947a121..7258e347 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java +++ b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java @@ -89,7 +89,7 @@ public class Fabric extends BasicListener { } Storage.fabricExpectPluginMessage.remove(player); - List mods = new LinkedList<>(); + ArrayList mods = new ArrayList<>(); Utils.VarInt varInt = Utils.readVarInt(data,0); @@ -127,6 +127,8 @@ public class Fabric extends BasicListener { return; } + user.setActiveMods(mods); + if(Utils.handleMods(player,mods)) { if (Storage.fabricCheckedPlayers.containsKey(player)) { long current = Storage.fabricCheckedPlayers.get(player); @@ -139,7 +141,6 @@ public class Fabric extends BasicListener { Storage.fabricCheckedPlayers.put(player, dataString.hashCode()); } Storage.fabricPlayers.remove(player); - user.setActiveMods(mods); } } @@ -164,7 +165,6 @@ public class Fabric extends BasicListener { public static void remove(ProxiedPlayer player) { Storage.fabricCheckedPlayers.remove(player); - SteamwarUser.get(player.getUniqueId()).setActiveMods(new LinkedList<>()); synchronized (Storage.fabricExpectPluginMessage) { Storage.fabricExpectPluginMessage.remove(player); } diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index dbafd60c..bb87728e 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -39,6 +39,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; import java.util.*; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import java.util.stream.Collectors; @@ -80,7 +81,7 @@ public class SteamwarUser { private Locale locale; private boolean manualLocale; - private List activeMods = new LinkedList<>(); + private List activeMods = new CopyOnWriteArrayList<>(); static { try { @@ -396,8 +397,11 @@ public class SteamwarUser { } public void setActiveMods(List activeMods) { - this.activeMods = activeMods; + this.activeMods.clear(); + this.activeMods.addAll(activeMods); } - public List getActiveMods() {return this.activeMods;} + public List getActiveMods() { + return new ArrayList<>(activeMods); + } }