Improve SaveListener.
Save challenges un world save event only if in current world has any challenge.
This commit is contained in:
parent
4edc1c5c62
commit
b1c12e7454
|
@ -23,7 +23,10 @@ public class SaveListener implements Listener
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onWorldSave(WorldSaveEvent e)
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue