Skip to content

Commit

Permalink
Fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Mar 12, 2023
1 parent c9ed2f7 commit 4ac45c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions patches/server/0002-Leaf-Config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ index 1141b3a88e2eb1baa705b4f781353df0305a7c85..b104a38d2c879b649a3862876c389564
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..511bc2175c4f25723bfdf59ae0ecb20e6fff1956
index 0000000000000000000000000000000000000000..b3eef4b3619255f1f6084c2985b0fe242d25cc34
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -0,0 +1,167 @@
Expand Down Expand Up @@ -210,11 +210,11 @@ index 0000000000000000000000000000000000000000..511bc2175c4f25723bfdf59ae0ecb20e
+ }
+
+ static Map<String, Object> getMap(String key, Map<String, Object> defaultValue) {
+ if (defaultValue != null && config.getConfigurationSection(key) == null) {
+ if (defaultValue != null && getConfigCopy().getConfigurationSection(key) == null) {
+ config.addDefault(key, defaultValue);
+ return defaultValue;
+ }
+ return toMap(convertToBukkit(config.getConfigurationSection(key)));
+ return toMap(getConfigCopy().getConfigurationSection(key));
+ }
+
+ private static Map<String, Object> toMap(ConfigurationSection section) {
Expand Down

0 comments on commit 4ac45c3

Please sign in to comment.