From 943988778521ca4a0449fd819605dc6a1fd44ac1 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 8 Jun 2022 13:18:24 +0200 Subject: [PATCH 1/3] Fix TablistManager for newer BTLP plugin --- CommonCore | 2 +- src/de/steamwar/bungeecore/listeners/TablistManager.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CommonCore b/CommonCore index 919c4d5..492894c 160000 --- a/CommonCore +++ b/CommonCore @@ -1 +1 @@ -Subproject commit 919c4d525ea39756b24bd961bb72d8d58bdd5bd4 +Subproject commit 492894ca8d41ee0bde4dcb9d520db5f7478c50c7 diff --git a/src/de/steamwar/bungeecore/listeners/TablistManager.java b/src/de/steamwar/bungeecore/listeners/TablistManager.java index b7dd44b..6730c51 100644 --- a/src/de/steamwar/bungeecore/listeners/TablistManager.java +++ b/src/de/steamwar/bungeecore/listeners/TablistManager.java @@ -29,6 +29,7 @@ import de.steamwar.bungeecore.Subserver; import de.steamwar.bungeecore.comms.packets.FightInfoPacket; import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.UserGroup; +import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -48,7 +49,9 @@ public class TablistManager extends BasicListener { @EventHandler public synchronized void onJoin(PostLoginEvent e){ - tablists.put(e.getPlayer(), new Tablist(e.getPlayer())); + BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> { + tablists.put(e.getPlayer(), new Tablist(e.getPlayer())); + }, 1, TimeUnit.SECONDS); } @EventHandler From 6769fd88e7c0105a92d0da5527911bf8ed19fc86 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 8 Jun 2022 16:06:31 +0200 Subject: [PATCH 2/3] Fix TablistManager --- src/de/steamwar/bungeecore/listeners/TablistManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/listeners/TablistManager.java b/src/de/steamwar/bungeecore/listeners/TablistManager.java index 6730c51..48d9adb 100644 --- a/src/de/steamwar/bungeecore/listeners/TablistManager.java +++ b/src/de/steamwar/bungeecore/listeners/TablistManager.java @@ -50,7 +50,9 @@ public class TablistManager extends BasicListener { @EventHandler public synchronized void onJoin(PostLoginEvent e){ BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> { - tablists.put(e.getPlayer(), new Tablist(e.getPlayer())); + if (BungeeCord.getInstance().getPlayer(e.getPlayer().getUniqueId()) != null) { + tablists.put(e.getPlayer(), new Tablist(e.getPlayer())); + } }, 1, TimeUnit.SECONDS); } From 2f06ea374ec75e812a1555946c6efec8ac9b0726 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 8 Jun 2022 16:18:04 +0200 Subject: [PATCH 3/3] Simplify connection detection Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/listeners/TablistManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/listeners/TablistManager.java b/src/de/steamwar/bungeecore/listeners/TablistManager.java index 48d9adb..f2a76d5 100644 --- a/src/de/steamwar/bungeecore/listeners/TablistManager.java +++ b/src/de/steamwar/bungeecore/listeners/TablistManager.java @@ -50,7 +50,7 @@ public class TablistManager extends BasicListener { @EventHandler public synchronized void onJoin(PostLoginEvent e){ BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> { - if (BungeeCord.getInstance().getPlayer(e.getPlayer().getUniqueId()) != null) { + if (e.getPlayer().isConnected()) { tablists.put(e.getPlayer(), new Tablist(e.getPlayer())); } }, 1, TimeUnit.SECONDS);