aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2022-05-05 21:04:23 +0100
committerLuck <git@lucko.me>2022-05-05 21:04:23 +0100
commitc1bf08cd76f4ddee97a530f9ab4ffa613b6f27f1 (patch)
tree447a3b5d8c62006ecdb65043e7198f8213f17bc4
parentb077100667c1dee6e73da399e3484f92bbf67cb8 (diff)
downloadspark-c1bf08cd76f4ddee97a530f9ab4ffa613b6f27f1.tar.gz
spark-c1bf08cd76f4ddee97a530f9ab4ffa613b6f27f1.tar.bz2
spark-c1bf08cd76f4ddee97a530f9ab4ffa613b6f27f1.zip
Exclude feature-seeds from config (#189)
-rw-r--r--spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java1
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/AbstractServerConfigProvider.java14
2 files changed, 7 insertions, 8 deletions
diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java
index 0ef662c..831150f 100644
--- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java
+++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java
@@ -111,6 +111,7 @@ public class BukkitServerConfigProvider extends AbstractServerConfigProvider<Buk
.add("resource-pack")
.add("rcon<dot>password")
.add("level-seed")
+ .add("world-settings.*.feature-seeds")
.addAll(getTimingsHiddenConfigs())
.addAll(getSystemPropertyList("spark.serverconfigs.hiddenpaths"));
diff --git a/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/AbstractServerConfigProvider.java b/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/AbstractServerConfigProvider.java
index 7e04400..d09eb7c 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/AbstractServerConfigProvider.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/platform/serverconfig/AbstractServerConfigProvider.java
@@ -101,14 +101,12 @@ public abstract class AbstractServerConfigProvider<T extends Enum<T>> implements
JsonObject jsonObject = json.getAsJsonObject();
String member = path.removeFirst().replace("<dot>", ".");
- if (!jsonObject.has(member)) {
- return;
- }
-
- if (path.isEmpty()) {
- jsonObject.remove(member);
- } else {
- delete(jsonObject.get(member), path);
+ if (member.equals("*") || jsonObject.has(member)) {
+ if (path.isEmpty()) {
+ jsonObject.remove(member);
+ } else {
+ delete(jsonObject.get(member), path);
+ }
}
}