test+fix: deep generation tests + bug cleanup (licence, docs, deps)

Two cohesive passes that harden the latitude worldgen and clean up
long-standing inconsistencies.

== Bug fixes & doc alignment ==
- licence: set MIT in gradle.properties and neoforge.mods.toml
  (was "Not specified" - blocks distribution)
- OreAuditHandler: fix javadoc that referenced a non-existent system
  property; the trigger is the .oreaudit marker file. Add an explicit
  warning about the System.exit(0) and point to LatitudeGameTest as the
  non-destructive alternative
- KubeJS: remove the dead kubejs_version, the commented dependency and
  all README claims about an "automatic KubeJS script"/KubeJSIntegration
  class that no longer exists. Vanilla ore removal is now native via the
  neoforge:remove_features biome modifier
- README: refresh the technical header (1.21.1 / NeoForge 21.1.219 /
  Java 21 / v3.2, was 1.20.1/Forge/Java17/v2.1.5) and the shard-diamond
  surface note (both variants are generated, gated by shardDiamondOre)
- CLAUDE.md / CONFIG_INTEGRATION_GUIDE.md: mark the feature toggles and
  tool stats as wired (they read ModConfigs at runtime); correct the
  "hardcoded tools" claim

== Generation tests (56 unit + 6 GameTest, all green) ==
- Extract the pure geometry of LatitudeBiomeSource into LatitudeMath
  (temperature, 3-zone underground model, spawn safe zone, dual-octave
  selector index). LatitudeBiomeSource now delegates to it, so one
  source of truth drives both runtime and tests - no behaviour drift
- LatitudeMathTest (21): temperature clamp/monotonicity, zone boundaries
  without gaps, Deep Dark / cave threshold predicates, spawn-safe square
  symmetry, selector index bounds + near-uniform distribution
- BiomeBandTest (18): fromTemperature boundary cases, surface/ocean
  pool non-empty, cave biomes never in a surface pool
- ModConfigsTest (+2 guards): every ConfigHelper toggle string maps to
  a real FeatureToggleConfig field, so a typo cannot silently produce a
  dead toggle (default: return true)
- LatitudeGameTest (+4 server tests): determinism (1485 pts, 0 mismatch),
  no cave biome at surface (160k samples, 0 leak), surface continuity
  (7% transitions - large biomes), climate gradient (north=cold 100%,
  south=hot 100%, equator cold 0%)

== Build ==
- build.gradle: addModdingDependenciesTo(sourceSets.test) so pure unit
  tests can reference Minecraft types without a full game server
- neoforge.mods.toml: optional BOP/create/mekanism dependencies removed;
  declared with mandatory=false + versionRange="[0,)" they broke mod
  loading when the mods were absent ("requires X 0 or above"). Optional
  integration is already handled via data tags (required:false) and
  data-only recipes that no-op if the mod is missing
- gradlew: restore executable bit

Verification: ./gradlew test build -> BUILD SUCCESSFUL, 56/56 unit tests
            ./gradlew runGameTestServer -> 6/6 GameTests passed in 840ms
This commit is contained in:
feldenr
2026-06-20 22:33:06 +02:00
parent 0c831bdff8
commit dfff76b0f9
14 changed files with 963 additions and 106 deletions
+3 -3
View File
@@ -113,9 +113,9 @@ Located in `src/main/java/net/mcreator/customoregen/config/`:
**Current Implementation Status**:
- **✅ Ore Drops**: Fully implemented via `OreBreakEventHandler.java` which listens to `BlockEvent.BreakEvent` and calls `ConfigurableOreDropsProcedure.execute()` for all custom ores
- **⚠️ Tool Stats**: Config classes exist in `ModConfigs.java`, but tools currently have hardcoded values (e.g., `SharddiamondpickaxeItem.java:18` has `return 200` for durability). Config reading not yet implemented.
- **⚠️ Feature Toggles**: Defined in `FeatureToggleConfig` but not yet wired to block/item registration conditional logic
- **⚠️ Ore Generation**: Config values exist but worldgen JSON files still use hardcoded values
- **⚠️ Tool Stats**: Wired. Tools read their stats from `TOOL_STATS` config when the config is loaded, with a hardcoded fallback when not yet loaded (e.g. `SharddiamondpickaxeItem.java`: `return ModConfigs.isLoaded() ? ModConfigs.TOOL_STATS.shardDiamondPickaxeDurability.get() : 200;`). See also `ConfigHelper.getShardDiamondToolDurability/Speed/Damage`.
- **⚠️ Feature Toggles**: Wired (commit `48a0d797`). Toggles in `FeatureToggleConfig` drive ore *generation* via `ConfigGatedFeaturesModifier` + the `config_gated_features` biome modifiers in `data/custom_ore_gen/neoforge/biome_modifier/add_*_ores.json`. A regression test (`ModConfigsTest.testFeatureToggleConfig_declaresAllTogglesReferencedByConfigHelper()`) ensures every toggle string used by `ConfigHelper.isFeatureEnabled()` actually maps to a field on `FeatureToggleConfig`, so a typo can't silently produce a dead toggle. Note: item/block *registration* still always fires (toggling only gates worldgen, not whether the items exist in creative).
- **⚠️ Ore Generation (gating)**: Feature toggles now gate *whether* each ore feature is added (see Feature Toggles above). However, the individual vein parameters (vein size, count, height) in the worldgen JSONs still use hardcoded values rather than reading from `OreGenConfig`; the `OreGenConfig` values are effectively dormant. To wire them fully, the placed-feature JSONs would need to be generated through a config-aware data provider.
- **⚠️ Enchantability**: `EnchantabilityFix.java` exists but is commented out - enchantment values not yet applied to items
### Ore Biome Finder