Fixed needing to delay certain tasks after pp reload

This commit is contained in:
Esophose 2020-12-02 22:09:41 -07:00
parent 356d700c78
commit 89a19d308e

View file

@ -20,10 +20,12 @@ public class ReloadCommandModule implements CommandModule {
LocaleManager localeManager = playerParticles.getManager(LocaleManager.class);
if (playerParticles.getManager(PermissionManager.class).canReloadPlugin(pplayer.getUnderlyingExecutor())) {
playerParticles.reload();
ParticleEffect.reloadSettings();
DefaultStyles.reloadSettings(playerParticles.getManager(ParticleStyleManager.class));
localeManager.sendMessage(pplayer, "reload-success");
playerParticles.getLogger().info("Reloaded configuration.");
Bukkit.getScheduler().runTaskLater(playerParticles, () -> {
ParticleEffect.reloadSettings();
DefaultStyles.reloadSettings(playerParticles.getManager(ParticleStyleManager.class));
localeManager.sendMessage(pplayer, "reload-success");
playerParticles.getLogger().info("Reloaded configuration.");
}, 10L);
} else {
localeManager.sendMessage(pplayer, "reload-no-permission");
}