From ee4259b88d1becf85ab46a6dc3be87a0ff5fea42 Mon Sep 17 00:00:00 2001 From: Librazy Date: Thu, 30 Aug 2018 18:23:56 +0800 Subject: [PATCH] Delay ProcessPlayerEvent by one tick, allowing other plugin to register their Handlers when /reload --- .../com/sk89q/worldguard/bukkit/WorldGuardPlugin.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java index 2ff1cef5..a8347cbd 100644 --- a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java +++ b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java @@ -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); }