mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-28 13:36:06 +01:00
Remove settings saving on addon disabling.
Settings are saved on each Settings GUI building.
This commit is contained in:
parent
ffac90f84c
commit
da5fab8558
@ -286,7 +286,14 @@ public class ChallengesAddon extends Addon {
|
||||
if (this.hooked) {
|
||||
this.challengesManager.save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method saves addon settings into file.
|
||||
*/
|
||||
public void saveSettings()
|
||||
{
|
||||
if (this.settings != null)
|
||||
{
|
||||
new Config<>(this, Settings.class).saveConfigObject(this.settings);
|
||||
|
@ -124,6 +124,10 @@ public class EditSettingsGUI extends CommonGUI
|
||||
// Return Button
|
||||
panelBuilder.item(44, this.returnButton);
|
||||
|
||||
// Save Settings every time this GUI is created. It will avoid issues with
|
||||
// Overwritten setting after server stop.
|
||||
this.addon.saveSettings();
|
||||
|
||||
panelBuilder.build();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user