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 dc8ad69 commit be6a89a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit be6a89a

Please sign in to comment.