From 9182bda998eca029a669469aeceb56c4ee560f3b Mon Sep 17 00:00:00 2001 From: feldenr <135638674+feldenr@users.noreply.github.com> Date: Wed, 17 Jun 2026 13:28:49 +0200 Subject: [PATCH] fix(drops): make iron/gold ores ignore Fortune like vanilla Iron and Gold ores were the only ones reacting to Fortune (Fortune III could yield up to 4 raw iron/gold per block). In vanilla 1.21, iron and gold ores ignore Fortune entirely (the raw ore is smelted, not multiplied). Copper, lapis and redstone legitimately keep Fortune (vanilla behavior), so those are unchanged. Added pureGoldenOreEnableFortune and impureIronOreEnableFortune config toggles (default: false) for consistency with the other ores (which all have an enableFortune toggle) and wired them into both the ConfigurableOreDropsProcedure (XP path) and the CustomOreLootModifier (item drops path, authoritative). Verified after a GameTest run that NeoForge merges the new keys with the default false WITHOUT touching the user's existing custom drop values (e.g. minDrops/maxDrops overrides are preserved). GameTest still green: spawn=birch_forest | north=100% | south=100% | swamp=1.26% | deepDark=1.30% | caveBiomes=6.5%. --- .../java/net/mcreator/customoregen/config/ModConfigs.java | 8 ++++++++ .../mcreator/customoregen/loot/CustomOreLootModifier.java | 2 ++ .../procedures/ConfigurableOreDropsProcedure.java | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/main/java/net/mcreator/customoregen/config/ModConfigs.java b/src/main/java/net/mcreator/customoregen/config/ModConfigs.java index b9fbb5c0..2cf93b4f 100644 --- a/src/main/java/net/mcreator/customoregen/config/ModConfigs.java +++ b/src/main/java/net/mcreator/customoregen/config/ModConfigs.java @@ -238,12 +238,14 @@ public class ModConfigs { public final ModConfigSpec.ConfigValue pureGoldenOreMinDrops; public final ModConfigSpec.ConfigValue pureGoldenOreMaxDrops; + public final ModConfigSpec.BooleanValue pureGoldenOreEnableFortune; public final ModConfigSpec.ConfigValue ashCoalOreMinDrops; public final ModConfigSpec.ConfigValue ashCoalOreMaxDrops; public final ModConfigSpec.ConfigValue impureIronOreMinDrops; public final ModConfigSpec.ConfigValue impureIronOreMaxDrops; + public final ModConfigSpec.BooleanValue impureIronOreEnableFortune; public final ModConfigSpec.ConfigValue impureGoldOreMinDrops; public final ModConfigSpec.ConfigValue impureGoldOreMaxDrops; @@ -312,6 +314,9 @@ public class ModConfigs { pureGoldenOreMaxDrops = builder .comment("Maximum raw gold dropped by Pure Golden Ore (default: 1) - vanilla equivalent") .defineInRange("maxDrops", 1, 0, 64); + pureGoldenOreEnableFortune = builder + .comment("Enable Fortune enchantment on Pure Golden Ore (default: false) - vanilla iron/gold ores ignore Fortune") + .define("enableFortune", false); builder.pop(); builder.push("ash_coal_ore"); @@ -330,6 +335,9 @@ public class ModConfigs { impureIronOreMaxDrops = builder .comment("Maximum raw iron dropped by Iron Ore (default: 1) - vanilla equivalent") .defineInRange("ironMaxDrops", 1, 0, 64); + impureIronOreEnableFortune = builder + .comment("Enable Fortune enchantment on Iron Ore (default: false) - vanilla iron/gold ores ignore Fortune") + .define("enableFortune", false); impureGoldOreMinDrops = builder .comment("Minimum raw gold dropped by Impure Gold Ore (default: 1)") .defineInRange("goldMinDrops", 1, 0, 64); diff --git a/src/main/java/net/mcreator/customoregen/loot/CustomOreLootModifier.java b/src/main/java/net/mcreator/customoregen/loot/CustomOreLootModifier.java index db589a3e..b7fde16f 100644 --- a/src/main/java/net/mcreator/customoregen/loot/CustomOreLootModifier.java +++ b/src/main/java/net/mcreator/customoregen/loot/CustomOreLootModifier.java @@ -155,11 +155,13 @@ public class CustomOreLootModifier extends LootModifier { case "pure_golden": minDrops = ModConfigs.DROPS.pureGoldenOreMinDrops.get(); maxDrops = ModConfigs.DROPS.pureGoldenOreMaxDrops.get(); + enableFortune = ModConfigs.DROPS.pureGoldenOreEnableFortune.get(); dropItem = new ItemStack(Items.RAW_GOLD); break; case "impure_iron": minDrops = ModConfigs.DROPS.impureIronOreMinDrops.get(); maxDrops = ModConfigs.DROPS.impureIronOreMaxDrops.get(); + enableFortune = ModConfigs.DROPS.impureIronOreEnableFortune.get(); dropItem = new ItemStack(Items.RAW_IRON); break; case "lapis": diff --git a/src/main/java/net/mcreator/customoregen/procedures/ConfigurableOreDropsProcedure.java b/src/main/java/net/mcreator/customoregen/procedures/ConfigurableOreDropsProcedure.java index 38fdfc79..bd695daa 100644 --- a/src/main/java/net/mcreator/customoregen/procedures/ConfigurableOreDropsProcedure.java +++ b/src/main/java/net/mcreator/customoregen/procedures/ConfigurableOreDropsProcedure.java @@ -87,6 +87,7 @@ public class ConfigurableOreDropsProcedure { case "pure_golden": minDrops = ModConfigs.DROPS.pureGoldenOreMinDrops.get(); maxDrops = ModConfigs.DROPS.pureGoldenOreMaxDrops.get(); + enableFortune = ModConfigs.DROPS.pureGoldenOreEnableFortune.get(); dropItem = new ItemStack(Items.RAW_GOLD); break; @@ -99,6 +100,7 @@ public class ConfigurableOreDropsProcedure { case "impure_iron": minDrops = ModConfigs.DROPS.impureIronOreMinDrops.get(); maxDrops = ModConfigs.DROPS.impureIronOreMaxDrops.get(); + enableFortune = ModConfigs.DROPS.impureIronOreEnableFortune.get(); dropItem = new ItemStack(Items.RAW_IRON); break;