Solves the /restart issue.

This commit is contained in:
Ka0rX 2022-11-20 19:36:34 +01:00
parent c03400228f
commit f559d767d2

View File

@ -314,6 +314,12 @@ public class MMOCore extends JavaPlugin {
@Override
public void onDisable() {
//Executes all the pending asynchronous task (like saving the playerData)
Bukkit.getScheduler().getPendingTasks().forEach(worker -> {
if (worker.getOwner().equals(this)) {
((Runnable) worker).run();
}
});
// Save player data
for (PlayerData data : PlayerData.getAll())
if (data.isFullyLoaded()) {