Possible fix duplicate initialization;

Remove over-parallelism;

(cherry picked from commit e1861e68dc28469a2654bb29a0757769b8c845a0)
This commit is contained in:
HarvelsX 2023-08-01 03:41:15 +03:00
parent ce7b623c71
commit 4b5dc2ec3c
No known key found for this signature in database
GPG Key ID: 7A2A1DF1370CA403
2 changed files with 7 additions and 10 deletions

View File

@ -210,14 +210,12 @@ public void onEnable() {
}
worldListener.registerEvents();
getScheduler().runAsync(() -> {
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
getScheduler().runAtEntity(player, () -> {
ProcessPlayerEvent event = new ProcessPlayerEvent(player);
Events.fire(event);
});
}
});
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
getScheduler().executeAtEntity(player, () -> {
ProcessPlayerEvent event = new ProcessPlayerEvent(player);
Events.fire(event);
});
}
((SimpleFlagRegistry) WorldGuard.getInstance().getFlagRegistry()).setInitialized(true);
((SimpleDomainRegistry) WorldGuard.getInstance().getDomainRegistry()).setInitialized(true);

View File

@ -60,8 +60,7 @@ public void resetAllStates() {
@EventHandler
public void onPlayerProcess(ProcessPlayerEvent event) {
// Pre-load a session
LocalPlayer player = WorldGuardPlugin.inst().wrapPlayer(event.getPlayer());
get(player).initialize(player);
get(WorldGuardPlugin.inst().wrapPlayer(event.getPlayer()));
}
@Override