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

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