From b653d568f518fa42eafaebaa0a03214dbfce8ad1 Mon Sep 17 00:00:00 2001 From: ironboundred <44921987+ironboundred@users.noreply.github.com> Date: Sat, 1 Apr 2023 18:39:54 -0500 Subject: [PATCH] Reload when proxy reload event is fired (#33) --- .../java/net/william278/velocitab/tab/PlayerTabList.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/net/william278/velocitab/tab/PlayerTabList.java b/src/main/java/net/william278/velocitab/tab/PlayerTabList.java index 77efadc..21bcde7 100644 --- a/src/main/java/net/william278/velocitab/tab/PlayerTabList.java +++ b/src/main/java/net/william278/velocitab/tab/PlayerTabList.java @@ -3,6 +3,7 @@ package net.william278.velocitab.tab; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.connection.DisconnectEvent; import com.velocitypowered.api.event.player.ServerPostConnectEvent; +import com.velocitypowered.api.event.proxy.ProxyReloadEvent; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.player.TabList; @@ -244,4 +245,11 @@ public class PlayerTabList { return Optional.of(this.fallbackServers.stream().toList()); }); } + + @Subscribe + public void proxyReload(@NotNull ProxyReloadEvent event) { + plugin.loadSettings(); + reloadUpdate(); + plugin.log("Velocitab has been reloaded!"); + } }