From 56ecb7f76a3c34155ed9d48de5445dfb14449982 Mon Sep 17 00:00:00 2001 From: William Date: Sat, 22 Jan 2022 22:37:16 +0000 Subject: [PATCH] Use lowest event priority so HuskSync fires first --- .../husksync/bungeecord/listener/BungeeEventListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bungeecord/src/main/java/me/william278/husksync/bungeecord/listener/BungeeEventListener.java b/bungeecord/src/main/java/me/william278/husksync/bungeecord/listener/BungeeEventListener.java index 73c3b884..5da1e610 100644 --- a/bungeecord/src/main/java/me/william278/husksync/bungeecord/listener/BungeeEventListener.java +++ b/bungeecord/src/main/java/me/william278/husksync/bungeecord/listener/BungeeEventListener.java @@ -9,6 +9,7 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.event.PostLoginEvent; import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.event.EventHandler; +import net.md_5.bungee.event.EventPriority; import java.io.IOException; import java.util.Map; @@ -18,7 +19,7 @@ public class BungeeEventListener implements Listener { private static final HuskSyncBungeeCord plugin = HuskSyncBungeeCord.getInstance(); - @EventHandler + @EventHandler(priority = EventPriority.LOWEST) public void onPostLogin(PostLoginEvent event) { final ProxiedPlayer player = event.getPlayer(); ProxyServer.getInstance().getScheduler().runAsync(plugin, () -> { @@ -26,7 +27,7 @@ public class BungeeEventListener implements Listener { HuskSyncBungeeCord.dataManager.ensurePlayerExists(player.getUniqueId(), player.getName()); // Get the player's data from SQL - final Map data = HuskSyncBungeeCord.dataManager.getPlayerData(player.getUniqueId()); + final Map data = HuskSyncBungeeCord.dataManager.getPlayerData(player.getUniqueId()); // Update the player's data from SQL onto the cache assert data != null;