Skip to content

Commit

Permalink
Add reload listener
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3-M4513R committed Jul 21, 2023
1 parent a41162e commit 464b8eb
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.proxy.ProxyPingEvent;
import com.velocitypowered.api.event.proxy.ProxyReloadEvent;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.Player;
Expand Down Expand Up @@ -60,6 +61,15 @@ public void onProxyInitialization(ProxyInitializeEvent event) {
this.logger.info("Enabled");
}

@Subscribe
public void onVelocityReload(ProxyReloadEvent event){
config = new PersistenceService(logger, dataDirectory)
.loadConfig();
this.serverListEntryBuilder = new ServerListEntryBuilder(logger, config);

this.logger.info("Reloaded");
}

@Subscribe
public EventTask onServerPing(final ProxyPingEvent event) {
this.logger.trace("Server ping event received, adding players to server list entry...");
Expand Down

0 comments on commit 464b8eb

Please sign in to comment.