Load challenges on plugin reload

This commit is contained in:
Fabrizio La Rosa 2020-06-14 17:09:44 +02:00
parent 2892bd7192
commit 4f19d745a4

View File

@ -31,6 +31,12 @@ public class PlayerManager {
playersDirectory = new File(skyblock.getDataFolder(), "challenge-data");
if (!playersDirectory.exists())
playersDirectory.mkdirs();
Bukkit.getScheduler().runTask(skyblock, () -> {
for(Player p : Bukkit.getServer().getOnlinePlayers()){
loadPlayer(p.getUniqueId());
}
});
}
public HashMap<Challenge, Integer> getPlayer(UUID uuid) {