diff --git a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java index e683040..7df5be6 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java +++ b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java @@ -51,8 +51,6 @@ public class Fabric extends BasicListener { private static final Map checkedPlayers = new HashMap<>(); private static final Map expectPluginMessage = new HashMap<>(); - private static final Object OBJECT = new Object(); - { neededMods.add("java"); neededMods.add("minecraft"); @@ -60,7 +58,7 @@ public class Fabric extends BasicListener { neededMods.add("steamwarmodsender"); BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> { - synchronized (OBJECT) { + synchronized (expectPluginMessage) { for (Map.Entry entry : expectPluginMessage.entrySet()) { if (System.currentTimeMillis() - entry.getValue() > TimeUnit.SECONDS.toMillis(20)) { banPlayer(SteamwarUser.get(entry.getKey()), entry.getKey()); @@ -84,7 +82,7 @@ public class Fabric extends BasicListener { SteamwarUser user = SteamwarUser.get(player.getUniqueId()); if (!checkedPlayers.containsKey(player)) { - synchronized (OBJECT) { + synchronized (expectPluginMessage) { if (expectPluginMessage.containsKey(player)) { banPlayer(user, player); return; @@ -156,7 +154,7 @@ public class Fabric extends BasicListener { @EventHandler public void onServerSwitchEvent(ServerSwitchEvent e) { if (e.getFrom() == null) return; - synchronized (OBJECT) { + synchronized (expectPluginMessage) { expectPluginMessage.put(e.getPlayer(), System.currentTimeMillis()); } } @@ -189,8 +187,8 @@ public class Fabric extends BasicListener { } public static void remove(ProxiedPlayer player) { - synchronized (OBJECT) { - checkedPlayers.remove(player); + checkedPlayers.remove(player); + synchronized (expectPluginMessage) { expectPluginMessage.remove(player); } }