Skip to content

Commit

Permalink
Fix issue when Settings object were not saved on server shutdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Jan 26, 2019
1 parent f3fe85a commit 6d1f499
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/world/bentobox/challenges/ChallengesAddon.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package world.bentobox.challenges;

import org.bukkit.Bukkit;

import org.bukkit.Bukkit;
import java.util.Optional;

import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.hooks.VaultHook;
import world.bentobox.challenges.commands.ChallengesCommand;
import world.bentobox.challenges.commands.admin.Challenges;
import world.bentobox.challenges.listeners.ResetListener;
import world.bentobox.challenges.listeners.SaveListener;
import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.level.Level;


Expand Down Expand Up @@ -178,6 +178,11 @@ public void onDisable() {
if (this.hooked) {
this.challengesManager.save();
}

if (this.settings != null)
{
new Config<>(this, Settings.class).saveConfigObject(this.settings);
}
}


Expand Down

0 comments on commit 6d1f499

Please sign in to comment.