Reload when proxy reload event is fired (#33)

This commit is contained in:
ironboundred 2023-04-01 18:39:54 -05:00 committed by GitHub
parent 80e4aa45ac
commit b653d568f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ package net.william278.velocitab.tab;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.connection.DisconnectEvent; import com.velocitypowered.api.event.connection.DisconnectEvent;
import com.velocitypowered.api.event.player.ServerPostConnectEvent; 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.Player;
import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.player.TabList; import com.velocitypowered.api.proxy.player.TabList;
@ -244,4 +245,11 @@ public class PlayerTabList {
return Optional.of(this.fallbackServers.stream().toList()); return Optional.of(this.fallbackServers.stream().toList());
}); });
} }
@Subscribe
public void proxyReload(@NotNull ProxyReloadEvent event) {
plugin.loadSettings();
reloadUpdate();
plugin.log("Velocitab has been reloaded!");
}
} }