From be6a89a2bef77cfa15fa3ddf96d16c5569de217c Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Sun, 12 Mar 2023 03:34:38 -0400 Subject: [PATCH] Fix config --- patches/server/0002-Leaf-Config.patch | 6 +++--- .../0029-Purpur-Minecart-settings-and-WASD-controls.patch | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/server/0002-Leaf-Config.patch b/patches/server/0002-Leaf-Config.patch index e1eb7f09e..9a649fe42 100644 --- a/patches/server/0002-Leaf-Config.patch +++ b/patches/server/0002-Leaf-Config.patch @@ -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 @@ @@ -210,11 +210,11 @@ index 0000000000000000000000000000000000000000..511bc2175c4f25723bfdf59ae0ecb20e + } + + static Map getMap(String key, Map 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 toMap(ConfigurationSection section) { diff --git a/patches/server/0029-Purpur-Minecart-settings-and-WASD-controls.patch b/patches/server/0029-Purpur-Minecart-settings-and-WASD-controls.patch index db33c1d55..9c53536a3 100644 --- a/patches/server/0029-Purpur-Minecart-settings-and-WASD-controls.patch +++ b/patches/server/0029-Purpur-Minecart-settings-and-WASD-controls.patch @@ -175,7 +175,7 @@ index 25ce337ed266be7bafeacd9eb6f53a9474775fc5..86d765cd40cda9c8b7f4f7898d604ba2 protected final float explosionResistance; protected final boolean isRandomlyTicking; diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java -index 36e554b8fbfd27bee439804c62710324df4280f3..b62d5c8ea81b36e485a07ec0dad33542c4944476 100644 +index 4f7aaede7adf8c8a74fbb202c7b29a65297e78d7..2b01407b13b77806502f16ec50d0014432f39238 100644 --- a/src/main/java/org/dreeam/leaf/LeafConfig.java +++ b/src/main/java/org/dreeam/leaf/LeafConfig.java @@ -6,8 +6,10 @@ import net.minecraft.core.registries.BuiltInRegistries; @@ -215,7 +215,7 @@ index 36e554b8fbfd27bee439804c62710324df4280f3..b62d5c8ea81b36e485a07ec0dad33542 + minecartControllableHopBoost = getDouble("gameplay-mechanics.minecart.controllable.hop-boost", minecartControllableHopBoost); + minecartControllableFallDamage = getBoolean("gameplay-mechanics.minecart.controllable.fall-damage", minecartControllableFallDamage); + minecartControllableBaseSpeed = getDouble("gameplay-mechanics.minecart.controllable.base-speed", minecartControllableBaseSpeed); -+ ConfigurationSection section = convertToBukkit(config.getConfigurationSection("gameplay-mechanics.minecart.controllable.block-speed")); ++ ConfigurationSection section = getConfigCopy().getConfigurationSection("gameplay-mechanics.minecart.controllable.block-speed"); + if (section != null) { + for (String key : section.getKeys(false)) { + Block block = BuiltInRegistries.BLOCK.get(new ResourceLocation(key));