mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-12-01 06:53:37 +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) {
|
if (this.hooked) {
|
||||||
this.challengesManager.save();
|
this.challengesManager.save();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method saves addon settings into file.
|
||||||
|
*/
|
||||||
|
public void saveSettings()
|
||||||
|
{
|
||||||
if (this.settings != null)
|
if (this.settings != null)
|
||||||
{
|
{
|
||||||
new Config<>(this, Settings.class).saveConfigObject(this.settings);
|
new Config<>(this, Settings.class).saveConfigObject(this.settings);
|
||||||
|
@ -124,6 +124,10 @@ public class EditSettingsGUI extends CommonGUI
|
|||||||
// Return Button
|
// Return Button
|
||||||
panelBuilder.item(44, this.returnButton);
|
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();
|
panelBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user