-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
154 additions
and
51 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
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/de/eldoria/schematictools/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,26 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) EldoriaRPG Team and Contributor | ||
*/ | ||
package de.eldoria.schematictools.configuration; | ||
|
||
import de.eldoria.schematictools.configuration.elements.ToolRemoval; | ||
|
||
@SuppressWarnings("FieldMayBeFinal") | ||
public class ConfigFile { | ||
private boolean updateCheck = true; | ||
private ToolRemoval toolRemoval = new ToolRemoval(); | ||
|
||
public ToolRemoval toolRemoval() { | ||
return toolRemoval; | ||
} | ||
|
||
public void toolRemoval(ToolRemoval toolRemoval) { | ||
this.toolRemoval = toolRemoval; | ||
} | ||
|
||
public boolean updateCheck() { | ||
return updateCheck; | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
src/main/java/de/eldoria/schematictools/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,33 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) EldoriaRPG Team and Contributor | ||
*/ | ||
package de.eldoria.schematictools.configuration; | ||
|
||
import de.eldoria.eldoutilities.config.ConfigKey; | ||
import de.eldoria.eldoutilities.config.JacksonConfig; | ||
import de.eldoria.schematictools.configuration.elements.ToolRemoval; | ||
import de.eldoria.schematictools.configuration.elements.Tools; | ||
import org.bukkit.plugin.Plugin; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.nio.file.Path; | ||
|
||
public class JacksonConfiguration extends JacksonConfig<ConfigFile> implements Configuration { | ||
public static final ConfigKey<Tools> TOOLS = ConfigKey.of("Tools", Path.of("tools.yml"), Tools.class, Tools::new); | ||
|
||
public JacksonConfiguration(@NotNull Plugin plugin) { | ||
super(plugin, ConfigKey.defaultConfig(ConfigFile.class, ConfigFile::new)); | ||
} | ||
|
||
@Override | ||
public Tools tools() { | ||
return secondary(TOOLS); | ||
} | ||
|
||
@Override | ||
public ToolRemoval toolRemoval() { | ||
return main().toolRemoval(); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/de/eldoria/schematictools/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,43 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* | ||
* Copyright (C) EldoriaRPG Team and Contributor | ||
*/ | ||
package de.eldoria.schematictools.configuration; | ||
|
||
import de.eldoria.eldoutilities.configuration.EldoConfig; | ||
import de.eldoria.eldoutilities.utils.Consumers; | ||
import de.eldoria.schematictools.configuration.elements.ToolRemoval; | ||
import de.eldoria.schematictools.configuration.elements.Tools; | ||
import org.bukkit.plugin.Plugin; | ||
|
||
public class LegacyConfiguration extends EldoConfig implements Configuration { | ||
private Tools tools; | ||
private ToolRemoval toolRemoval; | ||
|
||
public LegacyConfiguration(Plugin plugin) { | ||
super(plugin); | ||
} | ||
|
||
@Override | ||
protected void reloadConfigs() { | ||
toolRemoval = getConfig().getObject("toolRemoval", ToolRemoval.class, new ToolRemoval()); | ||
tools = loadConfig("tools", Consumers.emptyConsumer(), false).getObject("tools", Tools.class, new Tools()); | ||
} | ||
|
||
@Override | ||
protected void saveConfigs() { | ||
getConfig().set("toolRemoval", toolRemoval); | ||
loadConfig("tools", Consumers.emptyConsumer(), false).set("tools", tools); | ||
} | ||
|
||
@Override | ||
public Tools tools() { | ||
return tools; | ||
} | ||
|
||
@Override | ||
public ToolRemoval toolRemoval() { | ||
return toolRemoval; | ||
} | ||
} |
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