Skip to content

Commit

Permalink
Improve SaveListener.
Browse files Browse the repository at this point in the history
Save challenges un world save event only if in current world has any challenge.
  • Loading branch information
BONNe committed Dec 18, 2018
1 parent 4edc1c5 commit b1c12e7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public SaveListener(ChallengesAddon addon) {
@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());
}
}


Expand Down

0 comments on commit b1c12e7

Please sign in to comment.