mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-30 06:23:25 +01:00
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
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user