Skip to content

Commit

Permalink
Uses common config object.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jul 27, 2019
1 parent cd3d55d commit bed0434
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/world/bentobox/skygrid/SkyGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class SkyGrid extends GameModeAddon {
private Settings settings;
private WorldStyles worldStyles;
private SkyGridGen gen;
private Config<Settings> configObject = new Config<>(this, Settings.class);

@Override
public void onLoad() {
Expand All @@ -40,7 +41,7 @@ public void onLoad() {
}

private void loadSettings() {
settings = new Config<>(this, Settings.class).loadConfigObject();
settings = configObject.loadConfigObject();
if (settings == null) {
// Disable
logError("SkyGrid settings could not load! Addon disabled.");
Expand Down Expand Up @@ -125,7 +126,7 @@ public WorldStyles getWorldStyles() {
@Override
public void saveWorldSettings() {
if (settings != null) {
new Config<>(this, Settings.class).saveConfigObject(settings);
configObject.saveConfigObject(settings);
}

}
Expand Down

0 comments on commit bed0434

Please sign in to comment.