Files
custom_ore_gem/src
feldenr 48a0d797f0 feat(config): make ore feature toggles actually gate generation + cleanup
The feature toggles (enableConcentratedOres, enableImpureOres, ...) were
defined in config but never read: ConfigHelper.isFeatureEnabled() had no
caller, so the toggles were decorative. Wiring them is non-trivial because
NeoForge biome modifiers are loaded as data at bootstrap, before ModConfig
exists, so a data JSON cannot read a runtime config value directly.

Fix: a custom BiomeModifier (ConfigGatedFeaturesModifier) registered as
'custom_ore_gen:config_gated_features'. Its modify() runs at world load, when
the config is available, and only adds each feature group when its toggle is
on. The six add_*_biomes_ores.json modifiers now use this type, with each ore
mapped to its toggle:
  - shardDiamondOre       -> shard diamonds (surface + deep)
  - concentratedOres       -> concentrated coal, deepslate diamond
  - impureOres             -> iron (+deepslate)
  - pureGoldenOre          -> pure golden (+deepslate)
  - customCopperOres       -> copper high/lower
  - customEmeraldOres      -> emerald high/lower
  - vanillaOreVariants     -> lapis, redstone (+deepslate)

With all toggles defaulting to true, behaviour is identical to the previous
neoforge:add_features modifiers (code-equivalent), so existing worlds keep
their ores.

Also fixes a pre-existing bug: sharddiamondblockore (surface shard diamond)
was referenced by no biome modifier and never generated; it is now linked via
the shard diamond group (neoforge:any).

Dead code removed: the ash_coal feature/drop config (enableAshCoalOre,
ashCoalOreMinDrops/MaxDrops) and the 'ash_coal' drop case referenced an ore
block that was deleted long ago, plus the 'Temporarily use coal' placeholder.

Testing: the latitude GameTest still passes. A new oreGatingMatchesConfig test
verifies the shard feature presence in biome settings matches the toggle, but
skips with a note on runGameTestServer (its level is a void world with no
decoration features, so biome modifiers are not observable there); run it
against a real world to exercise the ON/OFF assertion.
2026-06-17 21:21:53 +02:00
..