-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrate to jackson configuration * Add license header * Add updater
- Loading branch information
1 parent
70a6020
commit 05c6ec2
Showing
9 changed files
with
139 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/de/eldoria/survivalbrush/configuration/ConfigFile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) 2021 EldoriaRPG Team and Contributor | ||
*/ | ||
|
||
package de.eldoria.survivalbrush.configuration; | ||
|
||
@SuppressWarnings("FieldMayBeFinal") | ||
public class ConfigFile { | ||
private BlockSettings blockSettings = new BlockSettings(); | ||
|
||
public BlockSettings blockSettings() { | ||
return blockSettings; | ||
} | ||
|
||
public void blockSettings(BlockSettings blockSettings) { | ||
this.blockSettings = blockSettings; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/de/eldoria/survivalbrush/configuration/JacksonConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) 2021 EldoriaRPG Team and Contributor | ||
*/ | ||
|
||
package de.eldoria.survivalbrush.configuration; | ||
|
||
import de.eldoria.eldoutilities.config.ConfigKey; | ||
import de.eldoria.eldoutilities.config.JacksonConfig; | ||
import org.bukkit.plugin.Plugin; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class JacksonConfiguration extends JacksonConfig<ConfigFile> implements Configuration { | ||
public JacksonConfiguration(@NotNull Plugin plugin) { | ||
super(plugin, ConfigKey.defaultConfig(ConfigFile.class, ConfigFile::new)); | ||
} | ||
|
||
|
||
@Override | ||
public BlockSettings blockSettings() { | ||
return main().blockSettings(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/de/eldoria/survivalbrush/configuration/LegacyConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) 2021 EldoriaRPG Team and Contributor | ||
*/ | ||
|
||
package de.eldoria.survivalbrush.configuration; | ||
|
||
import de.eldoria.eldoutilities.configuration.EldoConfig; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public class LegacyConfiguration extends EldoConfig implements Configuration { | ||
private BlockSettings blockSettings; | ||
|
||
public LegacyConfiguration(Plugin plugin) { | ||
super(plugin); | ||
} | ||
|
||
@Override | ||
protected void reloadConfigs() { | ||
blockSettings = getConfig().getObject("blockSettings", BlockSettings.class, new BlockSettings()); | ||
} | ||
|
||
@Override | ||
protected void saveConfigs() { | ||
getConfig().set("blockSettings", blockSettings); | ||
} | ||
|
||
@Override | ||
public BlockSettings blockSettings() { | ||
return blockSettings; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.