9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-25 18:09:17 +00:00

Fix new config can't be generated caused by wrong purpur config version condition

It should be `<=` instead of `<`, to ensure older config and new generated config both can generate config keys under `world-settings.default.tools`.
(unless the config transfer version condition should be config version +1)
This commit is contained in:
Dreeam
2025-01-23 12:17:33 -05:00
parent 1fa1b7f50b
commit b11b9bbc40

View File

@@ -318,3 +318,54 @@ index bd93ee97982038789114f17ee369208fc6413796..aa201bd227dffb7442ec62b86b2435f0
} else if (maxProjectileChunkLoadsConfig.perProjectile.resetMovementAfterReachLimit) {
this.setDeltaMovement(0, this.getDeltaMovement().y, 0);
}
diff --git a/org/purpurmc/purpur/PurpurWorldConfig.java b/org/purpurmc/purpur/PurpurWorldConfig.java
index 2aac26f50958d8653eb1472daa7761d36093cf4c..e58be75264a319bc09988ce4f26cce95b41f9b50 100644
--- a/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -533,7 +533,7 @@ public class PurpurWorldConfig {
axeWeatherables.clear();
hoeTillables.clear();
shovelFlattenables.clear();
- if (PurpurConfig.version < 18) {
+ if (PurpurConfig.version <= 18) { // Leaf - Fix Pufferfish and Purpur patches
ConfigurationSection section = PurpurConfig.config.getConfigurationSection("world-settings." + worldName + ".tools.hoe.tilling");
if (section != null) {
PurpurConfig.config.set("world-settings." + worldName + ".tools.hoe.tillables", section);
@@ -545,16 +545,16 @@ public class PurpurWorldConfig {
PurpurConfig.config.set("world-settings.default.tools.hoe.tilling", null);
}
}
- if (PurpurConfig.version < 29) {
+ if (PurpurConfig.version <= 29) { // Leaf - Fix Pufferfish and Purpur patches
PurpurConfig.config.set("world-settings.default.tools.axe.strippables.minecraft:mangrove_log", Map.of("into", "minecraft:stripped_mangrove_log", "drops", new HashMap<String, Double>()));
PurpurConfig.config.set("world-settings.default.tools.axe.strippables.minecraft:mangrove_wood", Map.of("into", "minecraft:stripped_mangrove_wood", "drops", new HashMap<String, Double>()));
}
- if (PurpurConfig.version < 32) {
+ if (PurpurConfig.version <= 32) { // Leaf - Fix Pufferfish and Purpur patches
PurpurConfig.config.set("world-settings.default.tools.axe.strippables.minecraft:cherry_log", Map.of("into", "minecraft:stripped_cherry_log", "drops", new HashMap<String, Double>()));
PurpurConfig.config.set("world-settings.default.tools.axe.strippables.minecraft:cherry_wood", Map.of("into", "minecraft:stripped_cherry_wood", "drops", new HashMap<String, Double>()));
PurpurConfig.config.set("world-settings.default.tools.axe.strippables.minecraft:bamboo_block", Map.of("into", "minecraft:stripped_bamboo_block", "drops", new HashMap<String, Double>()));
}
- if (PurpurConfig.version < 33) {
+ if (PurpurConfig.version <= 33) { // Leaf - Fix Pufferfish and Purpur patches
getList("gameplay-mechanics.shovel-turns-block-to-grass-path", new ArrayList<String>(){{
add("minecraft:coarse_dirt");
add("minecraft:dirt");
@@ -567,7 +567,7 @@ public class PurpurWorldConfig {
});
set("gameplay-mechanics.shovel-turns-block-to-grass-path", null);
}
- if (PurpurConfig.version < 34) {
+ if (PurpurConfig.version <= 34) { // Leaf - Fix Pufferfish and Purpur patches
PurpurConfig.config.set("world-settings.default.tools.axe.waxables.minecraft:waxed_chiseled_copper", Map.of("into", "minecraft:chiseled_copper", "drops", new HashMap<String, Double>()));
PurpurConfig.config.set("world-settings.default.tools.axe.waxables.minecraft:waxed_exposed_chiseled_copper", Map.of("into", "minecraft:exposed_chiseled_copper", "drops", new HashMap<String, Double>()));
PurpurConfig.config.set("world-settings.default.tools.axe.waxables.minecraft:waxed_weathered_chiseled_copper", Map.of("into", "minecraft:weathered_chiseled_copper", "drops", new HashMap<String, Double>()));
@@ -606,7 +606,7 @@ public class PurpurWorldConfig {
PurpurConfig.config.set("world-settings.default.tools.axe.weatherables.minecraft:weathered_copper_bulb", Map.of("into", "minecraft:exposed_copper_bulb", "drops", new HashMap<String, Double>()));
PurpurConfig.config.set("world-settings.default.tools.axe.weatherables.minecraft:oxidized_copper_bulb", Map.of("into", "minecraft:weathered_copper_bulb", "drops", new HashMap<String, Double>()));
}
- if (PurpurConfig.version < 38) {
+ if (PurpurConfig.version <= 38) { // Leaf - Fix Pufferfish and Purpur patches
PurpurConfig.config.set("world-settings.default.tools.axe.strippables.minecraft:pale_oak_wood", Map.of("into", "minecraft:stripped_pale_oak_wood", "drops", new HashMap<String, Double>()));
PurpurConfig.config.set("world-settings.default.tools.axe.strippables.minecraft:pale_oak_log", Map.of("into", "minecraft:stripped_pale_oak_log", "drops", new HashMap<String, Double>()));
}