Delay ProcessPlayerEvent by one tick, allowing other plugin to register their Handlers when /reload

This commit is contained in:
Librazy 2018-08-30 18:23:56 +08:00
parent 8771173146
commit ee4259b88d
No known key found for this signature in database
GPG Key ID: D95C1E5C902A819A

View File

@ -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);
}