Improve SaveListener.

Save challenges un world save event only if in current world has any challenge.
This commit is contained in:
BONNe1704 2018-12-18 11:26:29 +02:00
parent 4edc1c5c62
commit b1c12e7454

View File

@ -23,7 +23,10 @@ public class SaveListener implements Listener
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onWorldSave(WorldSaveEvent e)
{
this.addon.getChallengesManager().save(e.isAsynchronous());
if (!this.addon.getChallengesManager().getAllChallengesList(e.getWorld()).isEmpty())
{
this.addon.getChallengesManager().save(e.isAsynchronous());
}
}