mirror of
https://github.com/funkemunky/AntiVPN.git
synced 2026-05-31 09:31:54 +00:00
Turning alerts on for players on reloads if they are already online
This commit is contained in:
@@ -71,6 +71,16 @@ public class AntiVPN {
|
||||
|
||||
//Registering commands
|
||||
INSTANCE.registerCommands();
|
||||
|
||||
//Turning on alerts of players who are already online.
|
||||
playerExecutor.getOnlinePlayers().forEach(player -> {
|
||||
//We want to make sure they even have permission to see alerts before we make a bunch
|
||||
//of unnecessary database queries.
|
||||
if(player.hasPermission("antivpn.command.alerts")) {
|
||||
//Running database check for enabled alerts.
|
||||
INSTANCE.database.alertsState(player.getUuid(), player::setAlertsEnabled);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
|
||||
Reference in New Issue
Block a user