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%.
This commit is contained in:
feldenr
2026-06-17 13:28:49 +02:00
parent 3ea6906369
commit 9182bda998
3 changed files with 12 additions and 0 deletions
@@ -238,12 +238,14 @@ public class ModConfigs {
public final ModConfigSpec.ConfigValue<Integer> pureGoldenOreMinDrops;
public final ModConfigSpec.ConfigValue<Integer> pureGoldenOreMaxDrops;
public final ModConfigSpec.BooleanValue pureGoldenOreEnableFortune;
public final ModConfigSpec.ConfigValue<Integer> ashCoalOreMinDrops;
public final ModConfigSpec.ConfigValue<Integer> ashCoalOreMaxDrops;
public final ModConfigSpec.ConfigValue<Integer> impureIronOreMinDrops;
public final ModConfigSpec.ConfigValue<Integer> impureIronOreMaxDrops;
public final ModConfigSpec.BooleanValue impureIronOreEnableFortune;
public final ModConfigSpec.ConfigValue<Integer> impureGoldOreMinDrops;
public final ModConfigSpec.ConfigValue<Integer> 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);
@@ -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":
@@ -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;