Skip to content

Commit

Permalink
Delay ProcessPlayerEvent by one tick, allowing other plugin to regist…
Browse files Browse the repository at this point in the history
…er their Handlers when /reload
  • Loading branch information
Librazy committed Aug 30, 2018
1 parent 8771173 commit ee4259b
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -212,10 +212,12 @@ public void onEnable() {
}
worldListener.registerEvents();

for (Player player : Bukkit.getServer().getOnlinePlayers()) {
ProcessPlayerEvent event = new ProcessPlayerEvent(player);
Events.fire(event);
}
Bukkit.getScheduler().runTask(this, () -> {
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
ProcessPlayerEvent event = new ProcessPlayerEvent(player);
Events.fire(event);
}
});

((SimpleFlagRegistry) WorldGuard.getInstance().getFlagRegistry()).setInitialized(true);
}
Expand Down

0 comments on commit ee4259b

Please sign in to comment.