Author SHA1 Message Date
feldenr baa1972289 fix(create): diamond dupe via mixer ignoring ingredient count
Create 6.x deserializes item ingredients of processing recipes with
plain Ingredient.CODEC, silently ignoring the "count" field. The
mixing recipe (9 shards -> 1 diamond, written as one ingredient with
count: 9) only consumed 1 shard per diamond; combined with
crushing/milling (1 diamond -> ~6 shards) this created an infinite
diamond duplication loop.

- List the shard 9 times as single-item ingredients (BasinRecipe
  consumes exactly 1 item per ingredient entry)
- Add CreateCompatRecipesTest guarding the invariants: 9 shards per
  diamond in mixing+crafting, and crushing/milling expected yield
  stays below 9 shards per diamond (loop can never be net-positive)
2026-07-20 23:57:21 +02:00
feldenr c94874f9f6 chore: untrack build artifacts (build/, run/, .gradle/, .plasma/)
These generated files are already covered by .gitignore but were
committed before it existed. They remain on disk, just untracked.
2026-07-20 23:11:57 +02:00
feldenr e179baaf25 feat(worldgen): v4.1 - latitude zones via density function + Lithosphere
- Replace custom LatitudeBiomeSource/BiomeBand system with
  LatitudeSignalDensityFunction + LatitudeZonePlacement (mixin-based)
- Add mandatory Lithosphere (mr_lithosphere) dependency + mixin config
- Override overworld/large_biomes noise_settings for ultra-wide terrain
- Rename remove_vanilla_ores -> z_remove_vanilla_ores (load order)
- Merge cold/hot/tempered biome tags into latitude_*_surface tags
- Rework OresCommand, OreBiomeFinderItem, ModConfigs for new system
- Remove obsolete latitude classes, tests & world preset overrides
- Bump mod_version 3.2 -> 4.1
2026-07-20 23:11:16 +02:00
feldenr e667083853 fix(worldgen): keep vanilla presets in world_preset/normal tag
The custom_ore_gen:ultra_wide_biome tag entry was the ONLY value, which
broke 'minecraft:normal' (the server default) - any server/world that
resolves the default world preset would fail to find normal and fall
back to a broken/vanilla worldgen. Now the tag is additive: it keeps
all six vanilla presets AND adds ultra_wide_biome.
2026-06-21 21:54:05 +02:00
feldenr a3168f7c74 fix(worldgen): caves piercing the surface - revert stretched terrain
The custom terrain (9 macro density functions stretched 2x in xz_scale)
made caves appear at the surface. Root cause found by offline analysis:

  final_density uses:  sloped_cheese * caves_final
  and caves_final is a spline over sloped_cheese with:
    location 0.1 -> value 0.0
    location 0.45 -> value 1.0
  So caves only materialise where sloped_cheese is in [0.1, 0.45].

  By stretching basic_topography / continents / topography_* (which all
  feed sloped_cheese via topography_mountains -> topography_final ->
  topography_swamps -> topography_rivers), sloped_cheese spent MUCH
  longer inside [0.1, 0.45] than it should - so caves punched through
  the surface everywhere instead of staying underground.

The vanilla large_biomes doesn't stretch these density functions either;
it uses a separate set of *_large noise parameters (continentalness_large,
temperature_large, ...) that are tuned TOGETHER with the cave density
function to keep sloped_cheese in its intended range.

Fix: drop the custom density functions and the custom noise settings
entirely. Point the ultra_wide_biome preset at minecraft:large_biomes
(shipped by Lithosphere) which is already balanced with the caves.
This keeps the spawn-dark-forest fix and the ultra-wide biome
distribution from LatitudeBiomeSource, with the proven large-biomes
relief that does not leak caves to the surface.

Verification: ./gradlew test -> BUILD SUCCESSFUL, 71/71 unit tests
            ./gradlew runGameTestServer -> 6/6 GameTests passed in 928ms,
              spawn=birch_forest (safe)
2026-06-21 21:43:57 +02:00
feldenr 600393399f feat(worldgen): custom ultra-large terrain + fix spawn-dark-forest bias
Two related worldgen improvements validated in-game with Distant
Horizons + Lithosphere. Build + 6 GameTests green.

== Custom ultra-large terrain (preset ultra_wide_biome) ==
The mod controlled biome distribution but not relief, so the "long
prairies / immense mountain chains" effect was weak (relief was the
vanilla one that changes every ~1-2k blocks). Added a custom noise
settings custom_ore_gen:ultra_large_biome, built on top of Lithosphere's
large_biomes (which the mod already depends on for the mountain/cave
density functions).

Approach (iteratively tuned - v1/v2 with amplitude boost created HOLES in
the terrain; this v3-safe is the one that works):
  - 34 density functions copied verbatim from lithosphere, re-pointed
    to the custom_ore_gen: namespace (so our preset can reference them).
  - Cave density functions are NOT copied (left pointing at lithosphere:)
    so cave generation stays the natural Lithosphere one.
  - NOISE parameter references are NEVER namespacespaced - the noise
    parameter definitions live in the lithosphere jar and we just
    reference them (this was the v2 crash: an "Unbound values in
    registry noise: [custom_ore_gen:rivers, ...]" crash).
  - 9 MACRO density functions are stretched 2x in xz_scale only:
    continents, mountains_shape, basic_topography, orogeny,
    topography_final, topography_mountains, topography_swamps,
    topography_rivers, topography_cliffs. These drive the large-scale
    relief, so the effect is "longer plains, longer mountain chains".
  - 25 DETAIL density functions are left UNTOUCHED (xz_scale = original):
    roughness, rivers, mesas, erosion_detail, lake_placement, etc. Details
    must NOT be stretched or the terrain becomes incoherent.
  - NO amplitude boost on sloped_cheese: a v1 attempt with a x1.3
    multiplier pushed final_density out of [-1,1], which broke the
    `squeeze` envelope and carved literal HOLES in the terrain.

The preset data/custom_ore_gen/worldgen/world_preset/ultra_wide_biome.json
now references custom_ore_gen:ultra_large_biome (instead of the vanilla
minecraft:overworld it pointed at after the tectonic preset cleanup).

== Fix: spawn always landed in dark_forest ==
Root cause found by offline analysis:
  - LatitudeBiomeSource.spawnSafeBiomes (plains/forest/birch/...) only
    applied inside a 191x191 square (SPAWN_SAFE_RADIUS=96).
  - LatitudeSpawnHandler.findSpawnBiome scans rings up to MAX_RADIUS=512,
    so once it wandered past 96 blocks it fell out of the safe square and
    into the latitude_temperate_surface pool - which contains dark_forest.
  - Worse: findSpawnBiome probed biomes at y=0 (underground), but the
    latitude biome legitimately differs between y=0 and y=64 (the 3-zone
    underground model extends latitude DOWNWARDS), so a "safe" biome at
    y=0 could be dark_forest at the actual surface.

Fix:
  - SPAWN_SAFE_RADIUS 96 -> 540 (covers the handler's MAX_RADIUS=512
    search so the safe-square guarantee applies to everything found).
  - SPAWN_SELECTOR_SCALE 0.02 -> 0.004 so the safe square is populated
    by large blocks of the same safe biome (instead of a per-block
    patchwork).
  - LatitudeSpawnHandler now probes biomes at SURFACE_Y=64 instead of
    y=0, so what it validates matches what the player actually sees.

LatitudeMathTest updated for the new radius (191->1079 inclusive square).

Verification: ./gradlew test build -> BUILD SUCCESSFUL, 71/71 unit tests
            ./gradlew runGameTestServer -> 6/6 GameTests passed in 1.0s,
              spawn=birch_forest (safe, not dark_forest),
              north=100% cold, south=100% hot, deepDark=1.3%
2026-06-21 16:13:47 +02:00
feldenr d0df118270 fix: remove redundant tectonic preset + dead custom noise settings
The mod shipped two world presets that produced the *exact same world*:
  ultra_wide_biome.json     -> settings:"custom_ore_gen:overworld"
  tectonic_ultra_wide_biome.json -> settings:"minecraft:overworld"

The only difference was which overworld noise settings they referenced, so I
compared the mod's custom_ore_gen:overworld against the vanilla
minecraft:overworld byte-for-byte. Verdict: 100% identical (same 109394 bytes,
11/11 fields identical including the 30k-char surface_rule). The custom noise
settings was dead weight - a pure clone of vanilla that changed nothing about
the terrain.

Removed:
  - data/custom_ore_gen/worldgen/world_preset/tectonic_ultra_wide_biome.json
  - data/custom_ore_gen/worldgen/noise_settings/overworld.json (109 KB dead clone)
  - the tectonic entry from data/minecraft/tags/worldgen/world_preset/normal.json
    (so it no longer appears in the world-creation menu)
  - the two tectonic_* lang keys in en_us.json / fr_fr.json

Kept ultra_wide_biome as the single latitude world preset, now pointing at
minecraft:overworld directly (no indirection through a cloned settings file).
This also drops a misleading "requires Tectonic" claim - the preset never had
anything to do with the Tectonic mod.

Verification: ./gradlew test build -> BUILD SUCCESSFUL, 71/71 unit tests
            ./gradlew runGameTestServer -> 6/6 GameTests passed in 1.0s
              (latitude gen still loads via the cleaned-up preset)
2026-06-21 11:31:58 +02:00
feldenr 0fb650bdb0 fix: remove dead config + enchant class, extract & test drop math
Three correctness passes that remove lie-to-the-user code and add real
test coverage on the drop logic. Nothing broke; build + 6 GameTests green.

== Remove dead OreGenConfig (lie to the user) ==
OreGenConfig (veinSize/veinsPerChunk/min/max) was NEVER read anywhere
(grep ORE_GEN. -> NONE), and its defaults did not even match the JSONs:
  - copperhighore: JSON count=20 vs config default 2 (10x)
  - concentratedcoalore: JSON count=10 vs default 2 (5x)
  - deepslateironore: JSON count=20 vs impureIronOreCount default 2 (10x)
  - sharddiamondblockore: JSON size=4 vs shardDiamondOreSize default 8 (2x)
So a user reading the generated .toml was actively misled ("2 iron veins
per chunk" when 20 generate). Branching it to runtime config is
architecturally impossible in NeoForge (datapacks load before the runtime
config - the same problem ConfigGatedFeaturesModifier solves). Removed
the class + instance + matching structural tests. Vein params now live
only in the data-driven JSONs, like vanilla.

== Remove dead EnchantabilityFix (non-compiling API) ==
EnchantabilityFix was fully commented out because it referenced
DataComponents.ENCHANTABLE and net.minecraft.world.item.enchantment.Enchantable,
which DO NOT EXIST in 1.21.1 (confirmed via javap on neoforge-21.1.219.jar:
only ENCHANTMENTS / ENCHANTMENT_GLINT_OVERRIDE / STORED_ENCHANTMENTS exist).
Uncommenting it would fail to compile. Enchantability already works
natively via the enchantable tags
(data/minecraft/tags/item/enchantable/{mining,weapon,armor,durability}.json
- all Shard Diamond tools + armor listed) combined with the Tier
getEnchantmentValue()==9. Deleted the dead class.

== Extract & test drop math ==
ConfigurableOreDropsProcedure is hand-written (git log shows fix(drops)/
replace-event-with-GlobalLootModifier commits, no MCreator regeneration).
Extracted the pure fortune/drop/XP math into OreDropMath -> procedure now
delegates: dropCount = OreDropMath.dropCount(...), XP = experienceFor(...).
Added OreDropMathTest (16 tests) covering:
  - isMultiDropOre classification
  - baseDropCount range + uniform coverage + degenerate (min==max, no draw)
  - fortune: disabled/level-0 are no-ops (no RNG consumed)
  - discrete ores: bonus bounded in [0, fortuneLevel], vanilla III distribution
  - multiplier ores: results are exact multiples of base, vanilla III distribution
  - dropCount random-draw order pinned (base then fortune)
  - XP: zero-XP types (iron/gold/copper), vanilla ranges, bounds hit
  - determinism: same seed -> identical sequences
The procedure is now correct-by-construction for the math; the only
untested part is the MC orchestration (player/tool/registry lookup, spawn).

== Docs ==
CLAUDE.md: mark feature toggles + enchantability as already-working,
correct the "hardcoded tools" / "EnchantabilityFix commented out" claims,
document the native enchantability path (tags + Tier.getEnchantmentValue).

Verification: ./gradlew test build -> BUILD SUCCESSFUL, 71/71 unit tests
            ./gradlew runGameTestServer -> 6/6 GameTests passed in 1.0s
2026-06-21 01:26:53 +02:00
feldenr dfff76b0f9 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
2026-06-20 22:33:06 +02:00
feldenr 0c831bdff8 fix(ores): prove ore generation works for BOP biomes + blacklist highland
Investigation of 'no ores in BOP biomes' (highland, shrubland) reported during
in-game testing. Root cause: the early version of ConfigGatedFeaturesModifier
used a static firstCallLogged flag and threw when the COMMON config was not yet
loaded at biome-info build time, so its features were silently dropped. That
was already fixed (per-instance flag + try/catch defaulting to enabled); this
commit proves the fix end-to-end and removes the leftover debug logging.

Two automated proofs added (no manual in-game testing needed):

1. oreFeaturesAcrossBiomes GameTest: queries each biome holder's
   modifiableBiomeInfo().get() (the generation settings AFTER NeoForge applies
   every biome modifier). Result: every temperate biome - vanilla AND Biomes
   O' Plenty (shrubland, field, moor, grassland, woodland, mediterranean_forest)
   - contains the custom iron/coal/shard features. All 2 GameTests pass.

2. OreAuditHandler: a file-gated diagnostic (active only when run/.oreaudit
   exists) that runs on a dedicated server, generates real chunks under the
   latitude world type, scans actual ore blocks per surface biome, writes
   ore_audit_report.txt, then stops. Run with level-type=
   custom_ore_gen:ultra_wide_biome + the .oreaudit flag. Result on a 12x12
   chunk scan: biomes with ores=5, biomes with zero ores=0. BOP biomes
   (biomesoplenty:moor, biomesoplenty:grassland) contain iron, coal and shard
   diamond, identical to vanilla biomes. Totals: shard=89 iron=2667 coal=4803.

Design change: biomesoplenty:highland removed from latitude_temperate_surface,
mountain_biomes and tempered_biomes tags. The user finds the biome ugly; it no
longer generates. (Its ore generation was already correct - the removal is a
pure aesthetic preference, not an ore fix.)
2026-06-18 22:14:26 +02:00
feldenr 147c9d6b4a fix(biomes): remove cross-climate tag leaks (copper/gold in temperate spawn)
minecraft:birch_forest was listed in BOTH latitude_hot_surface AND
latitude_temperate_surface. Since ore generation is gated on the climate
tags, the hot-band ores (copper, pure gold, redstone) were spawning in
birch_forest - the default temperate spawn biome - so players found copper
in what looks like a temperate forest. birch_forest is a vanilla temperate
biome (temperature 0.6) and is the configured safe spawn; it never belonged
in the hot tag. Removed from hot, kept in temperate.

Also fixed a second leak: minecraft:windswept_forest was in BOTH temperate
AND cold, so it received both temperate (iron/coal) and cold (lapis/diamond)
ores. Kept in temperate only (windswept forest is not a genuinely cold biome
like snowy/taiga/grove).

Validated: each surface biome now belongs to exactly one climate tag (no
overlap). Latitude GameTest still green: spawn=birch_forest | north=100% |
south=100% | swamp=1.26% | deepDark=1.30% | caveBiomes=6.5%.
2026-06-17 21:34:07 +02:00
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
feldenr 9182bda998 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%.
2026-06-17 13:28:49 +02:00
feldenr 3ea6906369 fix(create): repair processing recipes + make them standalone-safe
The Create processing recipes (crushing/milling/mixing) were broken in two
ways, plus leaked parse errors when Create was absent.

1. Format migration to Create 6.x (matched against native recipes in the
   Create 6.0.9 jar):
   - results entries: item -> id
   - processingTime -> processing_time (snake_case)
   - ingredients keep item (still correct in 6.x)

2. Phantom item references: 9 recipes targeted blocks that no longer exist
   (renamed/removed ores). Reaffected 8 to their real block (e.g.
   highlapisore -> lapisore, goldore -> puregoldenore, highcopperore ->
   copperhighore) and deleted 9 with no real equivalent or that would
   duplicate an existing recipe (deepslate variants of coal/copper/emerald
   that don't exist as blocks).
   Result: all 16 registered ore blocks now have at least one valid Create
   recipe (15 direct + sharddiamond via the forge:ores/shard_diamond tag).

3. Standalone safety: wrapped all 20 Create recipes + the Mekanism enriching
   recipe in neoforge:conditions (mod_loaded) so they only parse when the
   target mod is present. Without this, the RecipeManager logged ERRORs
   (Unknown registry key create:crushing) on every boot when the mod ran
   alone. Conditions use the sibling format, verified empirically.

Validated both configurations via runGameTestServer:
  - Standalone (Create + Mekanism absent): 0 recipe parse errors, latitude OK
  - With all mods (BOP + Tectonic + Create + JEI): 0 parse errors, recipes
    load, latitude OK (spawn=birch_forest | north=100% | south=100% |
    swamp=1.26% | deepDark=1.30% | caveBiomes=6.5%)

The mod has no hard dependency on Create (no compile dep, no Java imports,
optional in mods.toml) and now boots cleanly with zero recipe errors whether
or not Create/Mekanism are installed.
2026-06-16 22:34:53 +02:00
feldenr dac57d3c63 fix: synchronize ore generation with latitude climate tags
The ore biome modifiers still referenced the legacy climate tags
(cold_biomes / tempered_biomes / hot_biomes) which were out of sync with the
new latitude system (latitude_cold_surface / _temperate_surface / _hot_surface).
As a result ores did not spawn where the player would expect them, several BOP
biomes got no ores at all, and surface ores leaked into oceans.

All three climate modifiers now point at the latitude surface tags, so ore
distribution follows the climate exactly. Because the latitude tags exclude
oceans, the fix also removes iron/coal generation under oceans.

Result (verified by coverage analysis):
  North (cold/frozen)      -> Lapis + Diamond          (27 biomes, +16 BOP)
  Equator (temperate/spawn)-> Iron + Coal             (31 biomes, +21 BOP)
  South (hot)              -> Gold + Copper + Redstone(22 biomes, +11 BOP)
  0 orphan surface biomes; no ocean surface ores. GameTest still green.
2026-06-16 21:41:25 +02:00
feldenr fa8c40652b test+feat: depth-slice map validation + tune cave thresholds to target
Add geological depth slices to the automated GameTest: it now samples the
latitude world at three depths and renders one PNG per depth (a top-down
'view' of that Y layer):
  - latitude_map_surface.png  (Y=64)
  - latitude_map_mid_cave.png (Y=-15)
  - latitude_map_deep.png     (Y=-50)
plus a report section per slice and new assertions:
  - Deep Dark must stay rare in the deep zone (<8%)
  - cave biomes (lush/dripstone) must stay a minority in mid-cave (<25%)

Cave biome colors are now distinct (lush=green, dripstone=orange, deep_dark=
teal) so the slices are readable.

Tuned the cave thresholds using the test as a fast feedback loop (BiomeSource-
only sampling, ~30s per run, mods-independent):
  - CAVE_THRESHOLD 0.55 -> 0.38   (lush/dripstone pockets now ~6.5%)
  - DEEP_DARK_THRESHOLD 0.88 -> 0.55 (Deep Dark now legendary ~1.3%; was 0%)

Validated with BOP + Tectonic:
  spawn=birch_forest | north=100% | south=100% | swamp=1.26% |
  deepDark=1.30% | caveBiomes=6.5%
2026-06-16 21:26:32 +02:00
feldenr 060b77b506 feat: rethink cave generation - latitude extends underground, Deep Dark legendary
The previous implementation forced a uniform cave-biome slab (lush/dripstone/
deep_dark) across all of Y<30, which overrode the latitude logic for a huge
volume and made the Deep Dark far too common.

New 3-zone underground model keeps the latitude surface biome as the default
at every depth (mining under a desert feels like the desert) and only carves
rare cave features on top:

- Near surface (Y >= 0): latitude biome as-is, no override.
- Mid caves (-30 <= Y < 0): lush/dripstone pockets (~8%) matching the climate
  (humid/warm bands -> lush, dry/cold bands -> dripstone).
- Deep zone (Y < -30): legendary Deep Dark pockets (~1%, very low-frequency
  noise so they form large rare regions suitable for Ancient Cities); the
  surface latitude biome otherwise.

Deep Dark is removed from the biome band pools and driven solely by its own
noise, restoring it to a rare, legendary discovery. Cave biomes are now
resolved once and declared in possibleBiomes. BiomeBand.underground() removed
(caves are climate-driven, not band-pool-driven).

Validated by GameTest (BOP + Tectonic): spawn=birch_forest | north=100% |
south=100% | swamp=1.26%.
2026-06-16 21:12:17 +02:00
feldenr 45213d3580 fix(test): use tag membership for climate band assertions
With Biomes O' Plenty installed, the FROZEN/HOT bands are filled with BOP
cold/hot biomes which the previous hardcoded vanilla-only assertion sets
did not include, causing a false failure (FROZEN measured 31% vs real ~100%).

Assertions now resolve the surface tags from the real registry and check
membership, so vanilla + BOP biomes are both counted. Adds a per-band
breakdown to the report for easier diagnostics.

Validated with Create + JEI + Biomes O' Plenty + Tectonic + deps:
  spawn=birch_forest | north=100% | south=100% | swamp=1.26%
2026-06-15 23:10:24 +02:00
feldenr 169a447f7b test: add automated latitude validation via GameTest server
Run `./gradlew runGameTestServer` to validate the latitude biome system
without manual in-game testing. Boots a headless game server (full biome
registry), samples a 32000x32000 grid through LatitudeBiomeSource, renders a
PNG map and writes a distribution report, then asserts climate invariants:
  - spawn on a safe biome (plains/forest)
  - FROZEN band dominated by cold/frozen biomes (>60%)
  - HOT band dominated by warm/hot biomes (>60%)
  - swamp remains rare in the temperate band (<15%)

Outputs land in run/gametest-results/latitude/ (latitude_map.png +
latitude_report.txt). Sampling is BiomeSource-only (no chunk generation),
so it runs in ~35s regardless of installed mods.

- LatitudeGameTest: @GameTestHolder + @PrefixGameTestTemplate(false)
- structure/empty_1x1.nbt: minimal 1x1x1 air structure required by GameTest
- build.gradle: add gameTestServer run configuration
2026-06-15 21:07:43 +02:00
feldenr 7729eeb65c feat: latitude biome system with two world types + map validation command
Add a latitude-based world generation system: biomes are distributed by Z
coordinate (frozen north -> temperate equator -> hot south) with extremely
large biomes on a continental scale, plus full Biomes O' Plenty support.

World types (selectable in the world creation 'World Type' button):
- Ultra Wide Biome: latitude biomes + vanilla terrain (immune to Tectonic
  via a private noise_settings copy under custom_ore_gen).
- Tectonic Ultra Wide Biome: latitude biomes + minecraft:overworld terrain
  (uses Tectonic when present, vanilla otherwise).

Core implementation:
- LatitudeBiomeSource: custom BiomeSource distributing biomes by latitude.
  Temperature derived from Z with a boundary wobble, dual-octave selector
  noise for a flat biome distribution (no biome dominates), land/ocean mask,
  underground cave layer, moisture-driven rare swamp/mangrove pockets, and a
  guaranteed safe spawn zone (plains/forests) around the origin.
- BiomeBand: 5 climate bands (FROZEN/COLD/TEMPERATE/WARM/HOT) with vanilla
  surface pools + dedicated climate tags (latitude_*_surface) for optional
  BOP biomes via required:false, plus ocean and underground pools.
- WorldGenRegistration: DeferredRegister for the 'custom_ore_gen:latitude'
  BiomeSource codec.
- LatitudeSpawnHandler: pins spawn to a plains/forest biome on overworld load.

Validation:
- /latitude map [radius] [step]: samples the LatitudeBiomeSource on a large
  grid, renders a top-down PNG map (run/latitude/latitude_map.png) and writes
  a per-band distribution + invariant report (run/latitude/latitude_report.txt).

Constants tuned for a continental scale:
  TEMPERATURE_SCALE = 16000 (equator->pole)
  SURFACE_SELECTOR_SCALE = 0.00033 (biomes ~3000 blocks wide)

Swamp fix: removed from the common temperate surface tag and made rare
(~8% of temperate land via moisture noise), matching vanilla humidity biomes.
2026-06-14 22:59:09 +02:00
feldenr 74480d9d2c feat: replace event-based drops with Global Loot Modifier (fix Create drill crash)
- Add CustomOreLootModifier (Global Loot Modifier) handling all ore drops,
  ensuring compatibility with machines (Create drill/contraptions) and avoiding
  duplication. Handles silk touch (vanilla block / shard diamond block) and
  fortune via config-driven min/max drops.
- Register GLM serializer via DeferredRegister in CustomOreGenMod (user code block)
- Rewrite OreBreakEventHandler: remove direct drops mutation that caused
  UnsupportedOperationException on immutable list when broken by Create drill.
  Drops are now fully GLM-driven; handler only triggers XP/procedure logic.
- Migrate loot tables from loot_table/ (singular, 1.20) to loot_tables/
  (plural, NeoForge 1.21 format) for all 16 ore blocks.
- Declare GLM in data/neoforge/loot_modifiers/global_loot_modifiers.json
- Add Create crushing + milling recipes for diamond -> diamond shards
- Config tweaks: tool durabilities (pickaxe/axe/shovel 450, paxel 800),
  Pure Golden Ore maxHeight 256 -> 320
- Refresh shard diamond armor/item textures
- Simplify unit tests for new drop system
2026-06-14 11:08:59 +02:00
feldenrandClaude 3ef6f03244 fix: make ore generation biome-specific and add command permissions
- Replace overworld-wide ore spawning with biome-specific generation
- Delete add_custom_ores.json that caused ores to spawn everywhere
- Create 6 biome-specific modifiers:
  * add_cold_biomes_ores.json - Lapis, concentrated diamond
  * add_hot_biomes_ores.json - Pure gold, copper, redstone
  * add_mountain_biomes_ores.json - High emerald
  * add_rare_biomes_ores.json - Lower emerald
  * add_tempered_biomes_ores.json - Iron, concentrated coal
  * add_shard_diamond_ores.json - Shard diamond (all biomes)
- Add permission level 2 requirement to /ores and /ore commands

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
2026-02-03 14:06:50 +01:00
[email protected] 9e9c4d28d6 fix: resolve crash at startup by checking if config is loaded 2026-02-03 11:32:50 +01:00
[email protected] d0ae2916ad fix: resolve build errors and link tool/armor stats to config 2026-02-03 11:23:06 +01:00
[email protected] 7bd578797b chore: align ore drops and XP with vanilla 1.21 and add AGENTS.md guide 2026-02-03 09:23:25 +01:00
feldenr 93bb4afb97 refactor: cleanup block classes and migrate tests to NeoForge
- Removed onDestroyedByPlayer from blocks (now handled by OreBreakEventHandler)
- Updated tests to use NeoForge classes (ModConfigSpec instead of ForgeConfigSpec)
- Fixed EnchantabilityFix annotation and commented out placeholder code
- Updated pack.mcmeta format for 1.21.1
2026-02-02 23:21:11 +01:00
feldenr 0fa495474b fix: register config and update recipe formats for 1.21.1
- Registered ModConfigs.SPEC in CustomOreGenMod to avoid IllegalStateException
- Updated all recipe JSONs to use 'id' instead of 'item' in result fields
- Renamed mekanism recipes folder to match 1.21.1 conventions
2026-02-02 23:20:17 +01:00
feldenr bca6034dd7 fix: restore ore drops and make them configurable via procedure
- Renamed data folders to 1.21.1 standards (singular names)
- Implemented OreBreakEventHandler to call ConfigurableOreDropsProcedure
- Updated procedure and config to handle all custom and variant ores
- Modified loot tables to only handle Silk Touch (manual drops via procedure)
- Fixed missing drops issue caused by folder name mismatch in 1.21.1
2026-02-02 23:11:42 +01:00
feldenr 4b9a4b0a05 Fix custom ore drops and tool enchantability for 1.21 2026-02-02 22:24:52 +01:00
[email protected] b636fd4295 Fix world crash, restore custom ores, fix armor textures (NeoForge 1.21.1) 2026-02-02 16:57:31 +01:00
14683 changed files with 9640 additions and 1344672 deletions
+20 -1
View File
@@ -16,7 +16,26 @@
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git push)",
"Bash(wc:*)"
"Bash(wc:*)",
"Bash(git checkout:*)",
"mcp__zread__read_file",
"Bash(del:*)",
"Bash(export:*)",
"Bash(unset:*)",
"Bash(\"/c/Program Files/JetBrains/CLion 2025.2.1/jbr/bin/java.exe\" -version)",
"Bash(java:*)",
"Bash(where:*)",
"Bash(taskkill:*)",
"Bash(dir:*)",
"Bash(dir \"C:\\\\Program Files\\\\Eclipse Adoptium\")",
"Bash(\"C:\\\\Program Files\\\\Java\\\\latest\\\\bin\\\\java.exe\":*)",
"Bash(/c/Program Files/Java/latest/bin/java.exe:*)",
"Bash(/c/Program Files/Java/jdk-24/bin/java.exe:*)",
"Bash(git show:*)",
"Bash(git fetch:*)",
"Bash(git pull:*)",
"Bash(set:*)",
"Bash(JAVA_HOME=/c/Program Files/Java/jdk-24 ./gradlew:*)"
]
}
}
+9
View File
@@ -0,0 +1,9 @@
run/
build/
.gradle/
bin/
*.log
*.log.gz
.DS_Store
nul
.plasma/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View File
Binary file not shown.
@@ -1,2 +0,0 @@
#Fri Jan 02 13:19:24 CET 2026
gradle.version=8.8
Binary file not shown.
Binary file not shown.
View File
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>custom_ore_gem</name>
<comment>Project custom_ore_gem created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1770104171004</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
@@ -0,0 +1,13 @@
arguments=--init-script C\:\\Users\\felden.r\\.local\\share\\opencode\\bin\\jdtls\\config_win\\org.eclipse.osgi\\58\\0\\.cp\\gradle\\init\\init.gradle
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=C\:/Program Files/Java/jdk-1.8
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
+172
View File
@@ -0,0 +1,172 @@
# Custom Ore Gem - Developer Guide for Agents
This repository is a Minecraft **NeoForge 1.21.1** mod created with **MCreator**. Agents must follow these strict guidelines to ensure build stability and code preservation.
## 1. Build & Test Commands
Use the Gradle wrapper for all operations. Ensure you are using Java 21 (NeoForge 1.21.1 requirement).
- **Build Mod:**
```bash
./gradlew build
```
- Generates the mod JAR in `build/libs/`.
- Always run this after making changes to verify compilation.
- **Run Client:**
```bash
./gradlew runClient
```
- **Run Server:**
```bash
./gradlew runServer
```
- **Run Data Generation:**
```bash
./gradlew runData
```
- This generates resources (blockstates, models, loot tables) into `src/generated/resources`.
- **Run All Tests:**
```bash
./gradlew test
```
- **Run Single Test Class:**
```bash
./gradlew test --tests "net.mcreator.customoregen.OresCommandTest"
```
- **Run Single Test Method:**
```bash
./gradlew test --tests "net.mcreator.customoregen.OresCommandTest.testCommandRegistration_ShouldRegisterOresCommand"
```
- **Clean Project:**
```bash
./gradlew clean
```
## 2. MCreator & Code Preservation
**CRITICAL:** This project is partially generated by MCreator.
- **Generated Files:** Many files in `src/main/java` are regenerated on every build or MCreator export.
- **User Code Blocks:** You **MUST** only edit code within designated user code blocks in these files.
```java
// Start of user code block [block_name]
// ... YOUR CODE HERE ...
// End of user code block [block_name]
```
- If a file does not have these blocks, assume it is **UNSAFE** to edit unless you created it yourself.
- **Safe Files:**
- Files strictly created by you (e.g., in `src/test/java`).
- New utility classes or event handlers not managed by MCreator.
- **Do NOT** directly modify the following unless inside a user block:
- `CustomOreGenModBlocks.java`
- `CustomOreGenModItems.java`
- `CustomOreGenModTabs.java`
- Any file in `net.mcreator.customoregen.procedures` (unless explicitly safe).
## 3. Code Style & Conventions
### Formatting
- **Indentation:**
- **Source Code (`src/main`):** Use **TABS** (default MCreator style).
- **Tests (`src/test`):** Use **4 SPACES** (typical for JUnit tests).
- **Consistency:** Always check the current file's indentation before editing.
- **Encoding:** UTF-8.
### Naming
- **Classes:** PascalCase (e.g., `CustomOreGenMod`).
- **Methods:** camelCase (e.g., `queueServerWork`).
- **Constants:** UPPER_SNAKE_CASE (e.g., `MODID`, `COLD_BIOMES_TAG`).
- **Fields:** camelCase (e.g., `workQueue`, `oreGenConfig`).
- **Packages:** `net.mcreator.customoregen` (lowercase).
### Imports
- Group imports in this specific order:
1. Java/Standard Libraries (`java.*`, `javax.*`)
2. Third-party Libraries (e.g., `org.apache.logging.log4j.*`)
3. Minecraft/NeoForge (`net.minecraft.*`, `net.neoforged.*`)
4. Project Classes (`net.mcreator.customoregen.*`)
- Avoid `import *` unless there are many imports from the same package (e.g., `java.util.*` is acceptable if heavily used, but explicit imports are preferred for clarity).
### Logging
- Use `LogManager.getLogger(Class.class)` for loggers.
- Field name: `LOGGER`.
- Log levels: Use `debug` for dev info, `info` for general status, `error` for exceptions.
## 4. Architecture & Patterns
- **Framework:** NeoForge 1.21.1 (Java 21).
- **Registries:** Use `DeferredRegister` for all registries (Blocks, Items, Tabs, SoundEvents).
- Example: `public static final DeferredRegister.Blocks REGISTRY = DeferredRegister.createBlocks(CustomOreGenMod.MODID);`
- **Event Bus:**
- The `@Mod` class registers the `IEventBus`.
- Use `@SubscribeEvent` for event handling.
- Event handlers often reside in `net.mcreator.customoregen.event` or static inner classes annotated with `@EventBusSubscriber`.
- **Configuration:**
- Located in `net.mcreator.customoregen.config.ModConfigs`.
- Uses `ModConfig.Type.COMMON` built with `ModConfigSpec`.
- Access configs via the public static fields (e.g., `ModConfigs.ORE_GEN.shardDiamondOreCount.get()`).
- **Commands:**
- Registered via `RegisterCommandsEvent`.
- Use Brigadier (`CommandDispatcher`, `CommandContext`).
- See `OresCommand.java` for the reference implementation.
## 5. Testing Guidelines
- **Framework:** JUnit 5 (Jupiter) + Mockito.
- **Location:** `src/test/java`.
- **Mocking Strategy:**
- Since a full Minecraft environment is not available in unit tests, you **MUST** mock Minecraft classes.
- Use `@ExtendWith(MockitoExtension.class)`.
- Mock critical classes: `@Mock ServerPlayer player`, `@Mock Level level`, `@Mock BlockPos pos`.
- Stub methods: `when(level.getBiome(pos)).thenReturn(biomeHolder);`.
- **Assertions:** Use `org.junit.jupiter.api.Assertions` (e.g., `assertEquals`, `assertDoesNotThrow`).
## 6. Common Tasks
- **Adding a New Ore:**
1. Create Block & Item (MCreator/Manual).
2. Add JSONs: Loot Table, Configured Feature, Placed Feature, Biome Modifier.
3. Register in `CustomOreGenModBlocks` and `CustomOreGenModItems`.
4. Update `OresCommand.java` lists (e.g., `COLD_ORES`, `HOT_ORES`) to make it discoverable.
5. Update `OreBreakEventHandler.java` if it has custom drops logic.
6. Add to `ModConfigs.java` for generation parameters (vein size, count, etc.).
- **Modifying Logic:**
- Check `procedures/` for game logic (often MCreator generated).
- Check `event/` for event-driven logic.
- Always verify if logic changes need a corresponding test update.
## 7. Safety & Verification
- **Backups:** If you are unsure about MCreator regeneration, backup the file before editing.
- **Verification:**
- Always run `./gradlew build` after changes to ensure no compilation errors.
- If you touch config files, ensure `ModConfigsTest` still passes.
- If you touch commands, ensure `OresCommandTest` still passes.
## 8. Directory Structure
```
src/
├── main/
│ ├── java/net/mcreator/customoregen/
│ │ ├── block/ # Block definitions
│ │ ├── config/ # Configuration classes
│ │ ├── event/ # Event handlers
│ │ ├── init/ # Registration (Blocks, Items, Tabs)
│ │ ├── item/ # Item definitions
│ │ └── procedures/ # Game logic procedures
│ └── resources/ # Assets and data (textures, models, lang)
└── test/
└── java/net/mcreator/customoregen/ # Unit tests
```
+85
View File
@@ -0,0 +1,85 @@
# Custom Ore Gen — 4.0 Changelog
**Custom Ore Gen 4.0** is a full rewrite, rebuilt from the ground up for **NeoForge 1.21.1**. It drops KubeJS entirely, introduces a brand-new **latitude-based ore system**, ships custom **ultra-wide terrain** via the Lithosphere companion, and turns the **Deep Dark into a legendary northern feature**.
This is the biggest update in the mod's history. Existing worlds from 2.x are **not** compatible — create a new world.
---
## 🆕 New Features
* **Latitude-based ore generation** — Ores are now distributed by your **Z coordinate** instead of biome categories. The world is split into three bands:
* ❄️ **Cold** (Z < 8000, north): Lapis, Deepslate Diamond
* 🔥 **Hot** (Z > 8000, south): Pure Gold, Redstone, Copper
* 🌳 **Temperate** (middle): Iron, Concentrated Coal
* Works with **any biome mod** out of the box — no per-biome classification needed.
* **Legendary Deep Dark** — The Deep Dark now only generates in cold northern latitudes, making it a true endgame destination rather than a random underground encounter. (Implemented via a safe, targeted mixin.)
* **Custom ultra-wide terrain** — Ships a handcrafted world generation through the new **Lithosphere** companion mod (now a required dependency).
* **Config-gated feature toggles** — A custom `ConfigGatedFeaturesModifier` makes the config feature toggles (`concentratedOres`, `impureOres`, `vanillaOreVariants`, etc.) actually gate world generation at runtime.
* **Global Loot Modifier for drops** — Replaced fragile event-based drops with a proper data-driven loot modifier (also fixed a crash with the Create drill).
* **Color-coded `/ores` command & Ore Biome Finder** — Output is now color-coded per zone (cold = aqua, hot = gold, temperate = green, shard ores = light purple) and clearly explains that the **Z coordinate** determines your zone.
* **Configurable zone thresholds** — The cold/hot thresholds (default Z = ±8000) are now adjustable in `custom-ore-gen-common.toml`.
* **Create & Mekanism compat** — Standalone-safe recipes for crushing, milling, mixing and enriching shard diamonds.
---
## ⚙️ Changes
* **Migrated from Forge 1.20.1 → NeoForge 1.21.1.**
* **Removed KubeJS dependency entirely.** Vanilla ores are now removed via NeoForge **biome modifiers** (`z_remove_vanilla_ores.json`) — no startup scripts, nothing to run.
* **New required dependency: Lithosphere 1.7+** — provides the custom terrain the mod is balanced for.
* Tool & armor stats are now **linked to config** — durability, speed, damage and armor values can all be tuned.
* Emeralds remain **biome-based** (mountain and rare-biome tags), since they're tied to terrain, not latitude.
* Rebalanced ore drop counts and XP to align with vanilla 1.21.
* Iron and Gold ores now **ignore Fortune** like vanilla.
* Paxel now affects every block mineable by pickaxe/shovel/axe tags.
* Rebalanced Diamond Shard tier as a clear bridge between iron and diamond.
---
## 🐛 Bug Fixes
* **Vanilla diamond leaked everywhere** — All **4** vanilla diamond placed features are now removed (`ore_diamond`, `ore_diamond_buried`, `ore_diamond_large`, `ore_diamond_medium`). Previously only 2 were removed, so buried/medium diamonds spawned in every biome.
* **Copper showed the wrong texture in deepslate** — Custom copper now uses the vanilla two-target approach (stone → `copper_ore`, deepslate → `deepslate_copper_ore`) instead of forcing `copper_ore` everywhere.
* **`/ores` always reported temperate** — `zoneName()` was reading static fields instead of the config getters; it now reads the live thresholds.
* **Garbage `6a9` prefix in ore listings** — Removed a broken color-code remnant that appeared in front of every ore name.
* **Diamond rate was way too high in cold zones** — Reduced the custom Deepslate Diamond `count` from 6 → 3 (combined with the vanilla leak fix, diamonds are now properly rare).
* **Server hung on startup** — Removed the `SpawnRelocator` and `OreAuditHandler` entirely. They forced synchronous chunk generation on the main server thread (a known cause of deadlocks and world corruption) and the audit handler shipped a `System.exit(0)` hard-kill. Both were dev-only diagnostics that never belonged in a release.
* **Badlands gold leaked into non-hot zones** — Added `ore_gold_extra` to the vanilla removal list.
* **Cross-climate tag leaks** — Removed copper/gold appearing in temperate spawns due to overlapping surface tags.
* **Caves piercing the surface** — Reverted the stretched terrain that caused cave openings to break the surface.
* **Create processing recipes** — Repaired and made them standalone-safe (no leftover references to removed ores).
* Various startup crashes, build errors and config-load race conditions resolved.
---
## 🗑️ Removals
* **KubeJS** — no longer used or required.
* Auto-generated `kubejs/startup_scripts/custom_ore_gen_remove_vanilla_ores.js` — replaced by biome modifiers.
* Dead config categories, unused `EnchantabilityFix` class, and redundant `tectonic`/custom noise settings.
* Legacy biome-tag surface files (`latitude_cold_surface`, `latitude_hot_surface`, `latitude_temperate_surface`, `cold_biomes`, `hot_biomes`, `tempered_biomes`, etc.) — superseded by the Z-based system.
---
## 🧪 Technical / Internal
* Mixed-in `MultiNoiseBiomeSource` to intercept Deep Dark biome resolution safely (Mojmap, no refmap needed on production).
* Custom `LatitudeZonePlacement` placement modifier filters ore placement by Z at the placed-feature level.
* Comprehensive test suite added: `OresCommandTest`, `ModConfigsTest`, `ConfigurableOreDropsProcedureTest`, `OreDropMathTest`, plus an automated GameTest server for latitude validation.
* Cleaned up block/item classes and migrated the entire test suite to NeoForge.
---
## 📦 Requirements
* Minecraft 1.21.1
* NeoForge 21.1.x
* **Lithosphere 1.7+** (required)
* Biomes O' Plenty, Create, Mekanism (optional, recommended)
---
> ⚠️ **Create a NEW world after updating.** Chunks generated before 4.0 keep their old ore distribution.
**Happy mining!** 🌍⛏️✨
+30
View File
@@ -0,0 +1,30 @@
# Custom Ore Gen — 4.1
A hotfix release that removes developer-only diagnostics that could destabilise dedicated servers. **No gameplay changes** — all ore generation, the Diamond Shard tier, the Deep Dark lock and mod compatibility are identical to 4.0.
---
## 🐛 Bug Fixes
* **Removed world/server-corrupting code** — Three developer-only diagnostic classes were accidentally shipped in 4.0. They have been removed entirely:
* `OreAuditHandler` — contained a `System.exit(0)` hard-kill that would terminate the server process, and forced chunk generation from a separate thread (a classic cause of chunk corruption).
* `SpawnRelocator` — forced synchronous chunk generation on the main server thread during startup, causing deadlocks and hang.
* `GenerationStabilityTest` — a GameTest utility that had no place in a release build.
* None of these classes were referenced by any gameplay code; removing them has **zero impact** on how the mod plays.
---
## 🔄 Changes
* Spawn-point behaviour reverts to vanilla (the removed `SpawnRelocator` no longer moves the spawn). Since the temperate band is 16,000 blocks wide, the vast majority of spawns still land in a balanced ore zone.
---
## ✅ Verification
* No `System.exit`, `Runtime.halt`, forced chunk loading (`getChunkAt`/`getChunk`), manual threads or `setBlock` calls remain anywhere in the codebase.
* Build and unit tests pass.
---
**Full build:** Minecraft 1.21.1 · NeoForge 21.1.x · Lithosphere 1.7+ (required)
+148 -31
View File
@@ -4,9 +4,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project Overview
Custom Ore Gem is a Minecraft Forge 1.20.1 mod (mod ID: `custom_ore_gen`) that modifies ore distribution and adds Diamond Shard-tier tools and armor. This is an **MCreator project** - code in `src/main/java` is partially regenerated on each build.
Custom Ore Gem is a Minecraft **NeoForge** 1.21.1 mod (mod ID: `custom_ore_gen`) that modifies ore distribution and adds Diamond Shard-tier tools and armor. This is an **MCreator project** - code in `src/main/java` is partially regenerated on each build.
**Key**: This mod is designed to work with KubeJS and is not meant to be used standalone.
**Note**: This mod replaces vanilla ore distribution with custom biome-based ore generation. For full functionality, it's recommended to use with KubeJS to remove vanilla ores (manual setup required).
## Build Commands
@@ -22,6 +22,9 @@ Custom Ore Gem is a Minecraft Forge 1.20.1 mod (mod ID: `custom_ore_gen`) that m
# Clean build artifacts
./gradlew clean
# Generate resources (data generation for assets/resources)
./gradlew runData
```
The built JAR is named `custom_ore_gen-{version}.jar` and appears in `build/libs/`.
@@ -30,14 +33,19 @@ The built JAR is named `custom_ore_gen-{version}.jar` and appears in `build/libs
### MCreator Workflow
This project uses MCreator. Important files contain regeneration markers:
This project uses MCreator. Files marked with `MCreator note: This file will be REGENERATED on each build.` at the top will be completely overwritten on each build. These include:
- `src/main/java/net/mcreator/customoregen/init/CustomOreGenModBlocks.java`
- `src/main/java/net/mcreator/customoregen/init/CustomOreGenModItems.java`
- `src/main/java/net/mcreator/customoregen/init/CustomOreGenModTabs.java`
**Protected User Code Blocks**: Only `CustomOreGenModItems.java` contains protected user code blocks:
```java
// Start of user code block [name]
// End of user code block [name]
// Start of user code block custom items
// End of user code block custom items
```
**Always preserve code between these markers** when editing. The file header notes which files are regenerated (e.g., `CustomOreGenModItems.java`).
**Always preserve code between these markers** when editing. All custom items (Ore Biome Finder, Shard Diamond armor, Paxel) are registered in this section.
### Package Structure
@@ -45,9 +53,11 @@ This project uses MCreator. Important files contain regeneration markers:
net.mcreator.customoregen/
├── CustomOreGenMod.java # Main mod class, registers event bus
├── OresCommand.java # /ores command implementation
├── block/ # Ore block classes (16 blocks)
├── ShardDiamondArmorMaterial.java # Armor material class for Shard Diamond armor
├── block/ # Ore block classes (17 blocks)
├── item/ # Items (Diamond Shard, tools, armor, Paxel, OreBiomeFinder)
├── config/ # Forge configuration system (ModConfigs.java)
├── config/ # NeoForge configuration system (ModConfigs.java)
├── event/ # Event handlers (OreBreakEventHandler)
├── procedures/ # Game logic (ConfigurableOreDropsProcedure, OreexperienceProcedure)
└── init/
├── CustomOreGenModBlocks.java # Block registry (deferred register)
@@ -57,7 +67,7 @@ net.mcreator.customoregen/
### Ore Generation System
The mod uses Forge biome modifiers to distribute ores based on biome temperature tags. The architecture:
The mod uses **NeoForge** biome modifiers to distribute ores based on biome temperature tags. The architecture:
1. **Biome Tags** (`src/main/resources/data/custom_ore_gen/tags/worldgen/biome/`):
- `cold_biomes.json` - Cold biomes (lapis, concentrated diamond)
@@ -65,14 +75,24 @@ The mod uses Forge biome modifiers to distribute ores based on biome temperature
- `mountain_biomes.json` - Mountain biomes (high emerald)
- `rare_biomes.json` - Rare biomes (lower emerald)
- `tempered_biomes.json` - Temperate biomes (iron, concentrated coal)
- BOP biomes are included with `"required": false` for optional compatibility
2. **Biome Modifiers** (`src/main/resources/data/custom_ore_gen/forge/biome_modifier/`):
2. **Biome Modifiers** (`src/main/resources/data/custom_ore_gen/neoforge/biome_modifier/`):
- Each ore has a JSON file linking it to biome tags
- Special case: `deepslatesharddiamondore_biome_modifier.json` uses `forge:any` for all biomes
- Special case: `deepslatesharddiamondore_biome_modifier.json` uses `"type": "forge:any"` for all biomes
- **JSON Structure**:
```json
{
"type": "neoforge:add_features",
"biomes": "custom_ore_gen:cold_biomes", // or {"type": "forge:any"} for all biomes
"features": "custom_ore_gen:deepslatesharddiamondore",
"step": "underground_ores"
}
```
3. **Worldgen Features** (`src/main/resources/data/custom_ore_gen/worldgen/`):
- `configured_feature/` - Defines ore vein size and height range
- `placed_feature/` - Places the feature in the world
- `placed_feature/` - Places the feature in the world with vertical anchors
### Diamond Shard Progression Tier
@@ -87,29 +107,39 @@ Diamond Shards are an intermediate tier between Iron and Diamond:
Located in `src/main/java/net/mcreator/customoregen/config/`:
- `ModConfigs.java` - Forge configuration with 4 sections: `ore_generation`, `tool_stats`, `drops`, `features`
- `ModConfigs.java` - NeoForge configuration with 4 nested config classes: `OreGenConfig`, `ToolStatsConfig`, `DropsConfig`, `FeatureToggleConfig`
- `ConfigHelper.java` - Utility class for accessing config values
- Generated config file: `config/custom_ore_gen-common.toml` (created on first run)
**Note**: As documented in `CONFIG_INTEGRATION_GUIDE.md`, the configuration system is partially implemented. Tool stats read from config, but ore drops require MCreator procedure integration to fully use config values.
**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**: 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 gate *whether* each ore feature is added (see Feature Toggles above). Vein parameters (size, count, height) are hard-coded in the data-driven worldgen JSONs under `data/custom_ore_gen/worldgen/` (`configured_feature/` + `placed_feature/`), exactly like vanilla; there is no runtime-config-driven ore parameter provider.
- **Enchantability**: Works natively in 1.21.1 via the enchantable tags (`data/minecraft/tags/item/enchantable/{mining,weapon,armor,durability}.json`, which include all Shard Diamond tools + armor) combined with `Tier.getEnchantmentValue() == 9` on the tool `Tier`s. The dead `EnchantabilityFix.java` class (which referenced the non-existent `DataComponents.ENCHANTABLE` / `net.minecraft.world.item.enchantment.Enchantable` from an earlier 1.20.5-snapshot API) has been removed.
### Ore Biome Finder
The `OreBiomeFinderItem` (`item/OreBiomeFinderItem.java`) and `/ores` command (`OresCommand.java`) detect which mod tags apply to the current biome and list findable ores. This works by checking if the biome is in any of the custom biome tags.
The `OreBiomeFinderItem` (`item/OreBiomeFinderItem.java`) and `/ores` command (`OresCommand.java`) detect which mod tags apply to the current biome and list findable ores.
**Implementation Details**:
- Uses `TagKey.create(Registries.BIOME, ResourceLocation.fromNamespaceAndPath("custom_ore_gen", "..."))` to define biome tags
- Checks `level.getBiome(pos()).is()` to test tag membership
- Displays biome ID, applicable tags, and ore list with height ranges
- Hardcoded ore lists by category (COLD_ORES, HOT_ORES, etc.) in `OreBiomeFinderItem.java`
## Adding a New Ore
To add a new ore type (requires MCreator for full integration):
1. **Create the block** in MCreator
2. **Add loot table** at `src/main/resources/data/custom_ore_gen/loot_tables/blocks/{orename}.json`
3. **Add configured_feature** JSON in `worldgen/configured_feature/`
4. **Add placed_feature** JSON in `worldgen/placed_feature/`
5. **Create biome_modifier** JSON linking to a biome tag (or create a new tag in `tags/worldgen/biome/`)
6. **Register** in `CustomOreGenModBlocks.java`
## Biomes O' Plenty Integration
The mod includes BOP biome support through additional biome tags. When adding BOP biomes, add them to the appropriate category tag JSON files in `tags/worldgen/biome/`.
1. **Create the block** in MCreator with proper properties (sound type, harvest level, etc.)
2. **Add loot table** at `src/main/resources/data/custom_ore_gen/loot_table/blocks/{orename}.json` (note: `loot_table` not `loot_tables`)
3. **Add configured_feature** JSON in `src/main/resources/data/custom_ore_gen/worldgen/configured_feature/`
4. **Add placed_feature** JSON in `src/main/resources/data/custom_ore_gen/worldgen/placed_feature/`
5. **Create biome_modifier** JSON in `src/main/resources/data/custom_ore_gen/neoforge/biome_modifier/` linking to a biome tag (or create a new tag in `tags/worldgen/biome/`)
6. **Add BOP entries** (optional) to appropriate biome tag JSON files with `"required": false` wrapper
7. **Update `OreBiomeFinderItem.java`** to add the new ore to the appropriate category list
8. **Add ore type mapping** in `OreBreakEventHandler.java` if you want configurable drops via `ConfigurableOreDropsProcedure`
## User Code Sections
@@ -119,12 +149,57 @@ When editing MCreator-generated files, only modify code between:
// End of user code block [section_name]
```
For example, in `CustomOreGenModItems.java`:
For example, in `CustomOreGenModItems.java` (lines 67-78):
```java
// Start of user code block custom items
public static final Supplier<Item> ORE_BIOME_FINDER = REGISTRY.register("ore_biome_finder", () -> new OreBiomeFinderItem());
// ... armor, paxel registrations
// End of user code block custom items
```
**Important**: Custom items like the Ore Biome Finder, Shard Diamond armor, and Paxel are registered in this protected section and will survive MCreator rebuilds.
## Event Handlers
The mod uses NeoForge's event system for ore processing:
### OreBreakEventHandler
- Listens to `BlockEvent.BreakEvent` with `@SubscribeEvent`
- Maps custom ore blocks to ore type strings (`shard_diamond`, `concentrated_coal`, `pure_golden`, etc.)
- Calls `ConfigurableOreDropsProcedure.execute()` with ore type when player breaks ore with correct tool
- Supports 10 ore types: shard_diamond, concentrated_coal, pure_golden, impure_iron, concentrated_diamond, lapis, redstone, emerald, copper
### Enchantability
- Implemented natively via 1.21.1 mechanisms: the Shard Diamond tools + armor are listed in `data/minecraft/tags/item/enchantable/{mining,weapon,armor,durability}.json`, and the tool `Tier`s return `getEnchantmentValue() == 9`.
- A former `EnchantabilityFix.java` used `ModifyDefaultComponentsEvent` to set a `DataComponents.ENCHANTABLE` component, but that API does not exist in 1.21.1 (only `ENCHANTMENTS`/`ENCHANTMENT_GLINT_OVERRIDE`/`STORED_ENCHANTMENTS` exist on `DataComponents`). The dead class has been deleted.
## Loot Table Format
NeoForge 1.21 uses `loot_table` (singular) instead of `loot_tables` (plural):
- Location: `src/main/resources/data/custom_ore_gen/loot_table/blocks/{orename}.json`
- Includes Silk Touch support via `match_tool` condition
- Uses `random_sequence` for loot table randomization
- Example structure in `deepslatesharddiamondore.json` shows Silk Touch → drop block, otherwise drops handled by `OreBreakEventHandler`
## Vanilla Ore Removal
The mod removes vanilla ores via NeoForge biome modifiers (NOT KubeJS anymore):
- `src/main/resources/data/custom_ore_gen/neoforge/biome_modifier/remove_vanilla_ores.json`
- Uses `neoforge:remove_features` type to remove vanilla ore generation
- This replaces the old KubeJS automatic script system from Forge 1.20.1
## Biomes O' Plenty Integration
The mod includes BOP biome support through biome tag entries. BOP biomes are wrapped with:
```json
{
"id": "biomesoplenty:biome_name",
"required": false
}
```
The `"required": false` flag ensures the game doesn't crash if BOP isn't installed. When adding new BOP biomes, add them to the appropriate category tag JSON files in `tags/worldgen/biome/`.
## Testing
After making changes:
@@ -132,9 +207,51 @@ After making changes:
2. Run `./gradlew runClient` to test in-game
3. Check logs in `run/logs/` for errors
## Version Info
## Enchantment Tags
- Minecraft: 1.20.1
- Forge: 47.3.0
- Java: 17
- Current mod version: 2.0.8 (defined in `build.gradle`)
The mod includes enchantment tags at `src/main/resources/data/minecraft/tags/item/enchantable/`:
- **armor.json** - Marks Shard Diamond armor pieces as enchantable
- **durability.json** - Marks tools and armor for durability enchantments
- **mining.json** - Marks pickaxes, shovels, and paxel as mining tools
- **weapon.json** - Marks axes as weapons
These tags enable proper enchantment behavior for custom items in the enchanting table and anvil.
## Important Notes
### README Disclaimer
The `README.md` file contains outdated information referring to Forge 1.20.1. The current codebase uses **NeoForge 1.21.1**. Always trust `gradle.properties` and this file for accurate version information.
### Recipe Compatibility
The mod includes recipes for:
- **Mekanism**: Enriching recipes for concentrated ores and shard diamond
- **Create**: Crushing and milling recipes for ore processing
- **Sculk Catalyst**: Diamond shard to sculk catalyst conversion
### Version Information
- **Minecraft**: 1.21.1
- **NeoForge**: 21.1.219 (defined in `gradle.properties` as `neo_version`)
- **Java**: 21 (configured via Java toolchain in build.gradle)
- **Mod Version**: 3.0 (defined in `gradle.properties` as `mod_version`)
### Mod Registration Order
In `CustomOreGenMod` constructor, registration order is:
1. `CustomOreGenModBlocks.REGISTRY.register(modEventBus)` - Blocks must be registered first
2. `CustomOreGenModItems.REGISTRY.register(modEventBus)` - Items depend on blocks for BlockItems
3. `CustomOreGenModTabs.REGISTRY.register(modEventBus)` - Creative tabs depend on items
### Server Work Queue Pattern
The mod includes a server tick work queue (`CustomOreGenMod.java:52-69`) for deferring execution:
- `queueServerWork(int tick, Runnable action)` - Schedule work to run after N server ticks
- Only executes on server thread (`SidedThreadGroups.SERVER`)
- Processed during `ServerTickEvent.Post`
- Use this for operations that need to happen after a delay or during gameplay
### DeferredRegister Pattern
All registries use NeoForge's `DeferredRegister.create(Registries.X, CustomOreGenMod.MODID)` pattern. This is the modern NeoForge 1.21 registration method replacing the old Forge registry system.
### NeoForge 1.21 Tool Tier Implementation
When creating custom tool items (Tier), you must implement `getIncorrectBlocksForDrops()`:
- Returns `TagKey<Block>` or `null`
- If `null`, all blocks can be dropped (current implementation in `SharddiamondpickaxeItem.java:38-40`)
- This replaces the old Forge 1.20 `getTier()` and incorrect blocks logic
+7 -1
View File
@@ -1,6 +1,12 @@
# Guide d'Intégration de la Configuration
## 📋 Vue d'Ensemble
> **Alerte statut (post-migration NeoForge 1.21, v3.2)** : ce guide décrit l'ancienne approche MCreator. La majorité des intégrations « restantes » ci-dessous sont **désormais réalisées** :
> - **Drops de minerais** : gérés par `CustomOreLootModifier` (Global Loot Modifier auto-enregistré), pas par une procédure de bloc MCreator. `OreBreakEventHandler` dispatche l'XP et appelle `ConfigurableOreDropsProcedure`.
> - **Feature toggles** : câblés (commit `48a0d797`) via `ConfigGatedFeaturesModifier` + les biome modifiers `data/custom_ore_gen/neoforge/biome_modifier/add_*_ores.json` (type `custom_ore_gen:config_gated_features`). Cela gate la **génération** des ores, pas l'enregistrement des blocs.
> - **Outils** : lisent `TOOL_STATS` config (`ModConfigs.isLoaded() ? config : fallback`).
> Les étapes MCreator détaillées plus bas sont conservées à titre historique mais ne sont plus nécessaires.
## Vue d'Ensemble
Le système de configuration est maintenant en place. Voici ce qui a été implémenté :
+176
View File
@@ -0,0 +1,176 @@
# 🔧 Custom Ore Gen
**Custom Ore Gen** completely overhauls Minecraft's ore generation by replacing vanilla distribution with a **latitude-based system** driven by the world's Z coordinate, and adds a complete intermediate equipment tier between iron and diamond: **Diamond Shards**.
After months of reworking, **version 4.0** is a full rewrite — rebuilt from the ground up for **NeoForge 1.21.1**, dropping KubeJS entirely in favor of fully data-driven biome modifiers, and introducing a brand-new world of latitude exploration.
***
## 🎯 Overview
A mod that:
* Replaces **all** vanilla overworld ore generation with a **latitude system** (north = cold, south = hot, middle = temperate)
* Adds a new intermediate equipment tier: **Diamond Shards**
* Encourages **north/south exploration** to gather specific resources
* Locks the **Deep Dark** to cold northern latitudes as a legendary feature
* The temperate band is **16,000 blocks wide** (Z = 8000 to +8000), so most spawns already land in a balanced area
* Ships custom **ultra-wide terrain** through its **Lithosphere** companion mod
* Automatically integrates with **Biomes O' Plenty**, **Create** and **Mekanism**
***
## 🌍 Latitude-Based Ore Generation
The world is split into three latitude bands running along the **Z axis**. Travel north or south to change which ores you can find — *your Z coordinate, not your biome, decides the ores* (Emeralds being the biome-tagged exception).
| Zone | Direction | Ores |
| --- | --- | --- |
| ❄️ **Cold** | North (Z < -8000) | Lapis, Deepslate Diamond |
| 🔥 **Hot** | South (Z > 8000) | Pure Gold, Redstone, Copper |
| 🌳 **Temperate** | Middle (-8000 → 8000) | Iron, Concentrated Coal |
| ⛰️ **Mountain biomes** | Anywhere (by biome tag) | High Emerald |
| ✨ **Rare biomes** | Anywhere (by biome tag) | Lower Emerald |
| 🔷 **All zones** | Everywhere | Deepslate Shard Diamond, Shard Diamond Block |
> ⚠️ **Note**: _Deepslate Shard Diamond Ore_ is the **only progression ore that spawns in ALL zones**, ensuring accessible early-game progression wherever you start. The temperate band is huge (16,000 blocks), so you almost always start in a balanced ore zone.
🧭 Use the **Ore Biome Finder** item or the **`/ores`** command to see exactly which ores are available at your current Z coordinate — the output is **color-coded per zone** (cold = aqua, hot = gold, temperate = green, shard ores = light purple).
***
## 💎 Diamond Shard Tier — New Progression
A complete set of tools and armor that bridges the gap between iron and diamond.
### ⚙️ **Available Equipment**
| Type | Components | Durability |
| --- | --- | --- |
| **Tools** (Pickaxe, Axe, Shovel) | Diamond Shards | 450 |
| **Paxel** (3-in-1 tool) | Diamond Shards | 800 |
| **Full Armor Set** | Diamond Shards + 2 Diamonds | 17 protection, Toughness 1.0 |
> ✅ **The Paxel** combines the functions of **pickaxe, axe, and shovel** into a single tool — affecting every block mineable by those tags.
> 🛠️ All stats above are the **defaults** — every durability, speed and damage value, plus the cold/hot zone thresholds and ore drops, is configurable in `custom-ore-gen-common.toml`.
### 🧪 **Shard → Diamond Conversion**
9 Diamond Shards → 1 Diamond (3×3 crafting grid).
### 🛡️ **Armor Recipes**
* **Helmet**: 5 Diamond Shards
* **Chestplate**: 8 Diamond Shards + 1 Diamond
* **Leggings**: 7 Diamond Shards + 1 Diamond
* **Boots**: 4 Diamond Shards
> ⚙️ **Repair** any Diamond Shard equipment with Diamond Shards on an anvil.
***
## 🔍 Ore Biome Finder
A handy tool to instantly know which ores are available at your current latitude.
🎮 **Alternatives**:
* Craft the **Ore Biome Finder** item (check JEI for the recipe).
* Use the **`/ores`** (or `/ore`) command — it shows your X/Z position, the zone determined by Z, the cold/hot thresholds, and a **color-coded** list of findable ores.
***
## 📦 Installation & Dependencies
### ⚠️ **Mandatory Requirements**
* **Minecraft**: 1.21.1
* **NeoForge**: 21.1.x
* **Lithosphere**: 1.7+ _(required — provides the custom ultra-wide terrain the mod is balanced for)_
### 🌐 **Optional but Recommended**
* **Biomes O' Plenty** — ore generation automatically extends to all its biomes.
* **Create** — ore-processing compat (crushing/milling shard diamond ore, mixing shards → diamond).
* **Mekanism** — enriching compat for shard diamonds.
> 🚫 The mod does **not** use KubeJS anymore. Vanilla ores are fully removed via NeoForge **biome modifiers** — no scripts, nothing to run.
***
## 🎮 Gameplay & Progression
1. **Initial Stage**
Start in the temperate band and mine **Deepslate Shard Diamond Ore** (available everywhere) to obtain **Diamond Shards**.
2. **First Equipment**
Craft Diamond Shard tools (or the versatile Paxel) for better efficiency than iron.
3. **Targeted Exploration**
Travel north or south along the Z axis to reach different ore zones:
* **North (Cold)**: Lapis and Deepslate Diamonds
* **South (Hot)**: Pure Gold, Redstone, Copper
* **Mountain biomes**: High Emeralds
* **Rare biomes**: Lower Emeralds
4. **Final Progression**
Combine 9 Diamond Shards to create a regular Diamond and access vanilla diamond equipment.
***
## 📊 Equipment Statistics Comparison
| Material | Protection | Chestplate Durability |
| --- | --- | --- |
| Iron | 15 | 240 |
| **Diamond Shard** | **17** | **300** |
| Diamond | 20 | 528 |
***
## 🌟 Key Features
* 🗺️ **Latitude Exploration**: the Z coordinate — not the biome — decides your ores
* 🌌 **Legendary Deep Dark**: locked to cold northern latitudes only (via a safe mixin)
* 🚀 **Custom Ultra-Wide Terrain**: ships with Lithosphere for a fresher, wider world
* ⚔️ **Balanced Progression**: Diamond Shard tier bridges the irondiamond gap
* 🚫 **No Vanilla Ores**: fully removed via data-driven biome modifiers (no scripts)
* 🌍 **Modpack Friendly**: automatic integration with any biome mod through the Z system
* 🎨 **Dedicated Creative Tab**: all mod items in the "Custom Ore Gen" tab
* 🛠️ **Versatile Tools**: the Paxel saves inventory space
* 📊 **In-game Info**: Finder item + `/ores` command with color-coded zones
* ⚙️ **Fully Configurable**: zone thresholds, tool stats, armor values and ore drops
***
## 🆕 What's New in 4.0
Version 4.0 is a ground-up rebuild. Highlights:
* **Full NeoForge 1.21.1 port** — left Forge 1.20.1 and KubeJS behind; everything is now data-driven biome modifiers.
* **Latitude ore system** — ores are now distributed by **Z coordinate** instead of biome categories, so it works with *any* biome mod out of the box.
* **Ultra-wide custom terrain** — bundled through the **Lithosphere** companion mod.
* **Legendary Deep Dark** — the Deep Dark now only generates in cold northern latitudes, making it a true endgame destination.
* **Create & Mekanism compat** — recipes for crushing, milling, mixing and enriching shard diamonds.
* **Color-coded `/ores` & Ore Finder** — clear, readable output that explains the Z mechanic.
* **Polished ore behaviour** — all 4 vanilla diamond features are properly removed, and copper now uses the correct deepslate texture underground.
> 💡 Existing worlds from older versions are **not** compatible — create a **new world** after installing 4.0.
***
## 📝 Important Notes
* ⚠️ **Create a NEW world** after installing. Chunks generated before installation keep their old ore distribution.
* The cold/hot zone thresholds default to **Z = ±8000** but are fully adjustable in the config.
* Emeralds remain **biome-based** (mountain and rare-biome tags), not latitude-based.
* All Diamond Shard equipment can be repaired with Diamond Shards.
***
### 🎯 **Why Choose Custom Ore Gen?**
Because it brings **logic to exploration** (travel the world to find specific ores), **smoother progression** (a real iron-to-diamond bridge), and **seamless integration** with many modded biomes — all without tedious configuration.
> **Happy mining!** 🌍⛏️✨
+23 -61
View File
@@ -2,30 +2,27 @@
## Description
Custom Ore Gem est un mod Minecraft développé avec MCreator pour Forge 1.20.1. Ce mod modifie la distribution des ressources dans Minecraft en ajoutant de nouvelles variantes de minerais avec des drops configurables et des outils personnalisés.
> **Note importante** : Ce mod est conçu pour être utilisé avec KubeJS et ne doit pas être utilisé seul.
Custom Ore Gem est un mod Minecraft développé avec MCreator pour NeoForge 1.21.1. Ce mod modifie la distribution des ressources dans Minecraft en redistribuant les minerais et les biomes selon des bandes climatiques par latitude (axe Z), avec des drops configurables et des outils personnalisés.
## Informations Techniques
- **Version de Minecraft** : 1.20.1
- **Mod Loader** : Forge (version 47.3.0)
- **Version de Java** : Java 17
- **Version de Minecraft** : 1.21.1
- **Mod Loader** : NeoForge (version 21.1.219)
- **Version de Java** : Java 21
- **Mod ID** : `custom_ore_gen`
- **Version** : 2.1.5
- **Version** : 3.2
- **Auteur** : Aulyrius (créé via MCreator)
- **Site web** : https://lanro.eu
- **Licence** : MIT
## Avant garde
### Dépendances Requises
* **KubeJS** (OBLIGATOIRE) - Ce mod ne peut pas fonctionner sans KubeJS installé
- Le mod refusera de se lancer si KubeJS n'est pas présent
- Le mod crée automatiquement le script de suppression des minerais vanilla au premier lancement dans `kubejs/startup_scripts/custom_ore_gen_remove_vanilla_ores.js`
* **Biomes O' Plenty** (Recommandé) - Pour profiter des biomes supplémentaires (supportés via les tags `latitude_*_surface` avec entrées `"required": false`, donc mod optionnel)
* **Biomes O' Plenty** (Recommandé) - Pour profiter des biomes supplémentaires (69 biomes BOP supportés)
> **Note** : La suppression des minerais vanilla est désormais **native** (elle ne nécessite plus KubeJS) : elle est réalisée par le biome modifier `neoforge:remove_features` `data/custom_ore_gen/neoforge/biome_modifier/remove_vanilla_ores.json`, appliqué à `#minecraft:is_overworld`.
* **Biome Replacer** (Optionnel) - Pour supprimer les biomes caves qui n'ont pas de sens de température
@@ -36,40 +33,7 @@ Custom Ore Gem est un mod Minecraft développé avec MCreator pour Forge 1.20.1.
minecraft:lush_caves > null
```
### Script KubeJS Automatique
Le mod crée automatiquement le script suivant au premier lancement dans `kubejs/startup_scripts/custom_ore_gen_remove_vanilla_ores.js` :
```javascript
// priority: 0
WorldgenEvents.remove(event => {
var minecraftOreList = [
'minecraft:coal_ore',
'minecraft:deepslate_coal_ore',
'minecraft:copper_ore',
'minecraft:deepslate_copper_ore',
'minecraft:iron_ore',
'minecraft:deepslate_iron_ore',
'minecraft:gold_ore',
'minecraft:deepslate_gold_ore',
'minecraft:redstone_ore',
'minecraft:deepslate_redstone_ore',
'minecraft:emerald_ore',
'minecraft:deepslate_emerald_ore',
'minecraft:diamond_ore',
'minecraft:deepslate_diamond_ore',
'minecraft:lapis_ore',
'minecraft:deepslate_lapis_ore'
];
event.removeOres(props => {
props.blocks = minecraftOreList
});
});
```
> **Note** : Le script n'est recréé que s'il n'existe pas déjà. Vous pouvez le modifier manuellement sans risque.
> La création automatique d'un script KubeJS a été supprimée. La suppression des minerais vanilla est maintenant native (voir section Dépendances ci-dessus). Aucune dépendance KubeJS n'est plus requise.
## Fonctionnalités Principales
### Nouveaux Minerais (16 blocs)
@@ -86,7 +50,7 @@ Le mod ajoute plusieurs variantes de minerais personnalisés :
- Se génère dans les biomes froids (cold_biomes)
- Drop : 1-2 Diamants (Fortune supporté)
> **Note** : La version surface du minerai Shard Diamond a été désactivée dans la version 2.1.5. Seule la version deepslate est disponible.
> **Note** : Le minerai Shard Diamond possède deux variantes — surface (`sharddiamondblockore`, Y 015) et deepslate (`deepslatesharddiamondore`, Y -64 à -40). Les deux sont générées dans tous les biomes et contrôlées par le toggle `shardDiamondOre`.
#### Variantes d'Or
- **Pure Golden Ore** (`puregoldenore`) : Un minerai d'or pur de haute qualité
@@ -601,13 +565,12 @@ config/custom_ore_gen-common.toml
## Installation
1. Assurez-vous d'avoir Minecraft 1.20.1 installé avec Forge 47.3.0+
2. **Installez KubeJS** (OBLIGATOIRE) - Le mod ne fonctionnera pas sans KubeJS
3. Placez le fichier `.jar` du mod dans le dossier `mods` de votre installation Minecraft
4. Lancez le jeu avec le profil Forge
5. Le mod créera automatiquement le script KubeJS nécessaire au premier lancement
1. Assurez-vous d'avoir Minecraft 1.21.1 installé avec NeoForge 21.1.219+
2. Placez le fichier `.jar` du mod dans le dossier `mods` de votre installation Minecraft
3. Lancez le jeu avec le profil NeoForge
4. Le mod crée sa configuration `config/custom_ore_gen-common.toml` au premier lancement
> **Important** : Ce mod nécessite KubeJS pour fonctionner. Le script de suppression des minerais vanilla sera créé automatiquement dans `kubejs/startup_scripts/custom_ore_gen_remove_vanilla_ores.js`.
> Le mod est autonome : aucune dépendance KubeJS n'est requise. La suppression native des minerais vanilla est appliquée via biome modifier au chargement du monde.
## Architecture du Code
@@ -617,7 +580,6 @@ config/custom_ore_gen-common.toml
net.mcreator.customoregen/
├── CustomOreGenMod.java # Classe principale du mod
├── OresCommand.java # Commande /ores pour détecter les minerais
├── KubeJSIntegration.java # Création automatique du script KubeJS
├── ShardDiamondArmorMaterial.java # Classe de matériau d'armure Diamond Shard
├── block/ # Classes des blocs (15 minerais)
│ ├── SharddiamondblockoreBlock.java
@@ -661,8 +623,9 @@ net.mcreator.customoregen/
### Classes Principales
- **CustomOreGenMod** : Point d'entrée du mod, gère l'initialisation et le réseau
- **KubeJSIntegration** : Crée automatiquement le script KubeJS de suppression des minerais vanilla au premier lancement du jeu
- **CustomOreGenMod** : Point d'entrée du mod, enregistre les DeferredRegister (blocs, items, armour, loot modifiers, worldgen codecs) et la config commune
- **LatitudeBiomeSource** : `BiomeSource` personnalisé distribuant les biomes par latitude (axe Z) avec un modèle souterrain à 3 zones
- **ConfigGatedFeaturesModifier** : `BiomeModifier` qui n'injecte les features d'ores que si leur toggle de config est activé
- **ShardDiamondArmorMaterial** : Classe de matériau d'armure Diamond Shard avec gestion des textures
- **OresCommand** : Commande `/ores` pour identifier les minerais du biome actuel
- **OreBiomeFinderItem** : Item utilisable pour détecter les minerais du biome (clic droit)
@@ -676,12 +639,12 @@ net.mcreator.customoregen/
Custom Ore Gen est conçu pour :
- **Modifier la distribution des ressources** Minecraft avec de nouvelles variantes de minerais basées sur la température des biomes
- **Fournir une dépendance obligatoire à KubeJS** avec création automatique du script de suppression des minerais vanilla
- **Redéfinir la distribution mondiale des biomes** en bandes climatiques par latitude (axe Z) avec biomes très grands pour encourager l'exploration
- **Introduire une progression intermédiaire** à travers les Diamond Shards (outils et armure entre fer et diamant)
- **Offrir des outils d'exploration** avec l'Ore Biome Finder et la commande `/ores`
- **Proposer un outil tout-en-un** avec le Paxel en Diamond Shard (1000 durabilité)
- **Fournir une armure intermédiaire** entre fer et diamant (17 protection, 1060 durabilité)
- **Faciliter l'installation** avec création automatique des scripts KubeJS nécessaires
- **Faciliter l'installation** (mod autonome, suppression native des minerais vanilla via biome modifier)
- **Supporter Biomes O' Plenty** avec 69 biomes supplémentaires classés par température
- **Fournir un onglet créatif dédié** regroupant tous les items du mod
@@ -691,11 +654,10 @@ Custom Ore Gen est conçu pour :
- ✅ Ajout de l'armure complète Diamond Shard (casque, plastron, jambières, bottes)
- ✅ Ajout du Paxel Diamond Shard (outil tout-en-un : pioche + pelle + hache)
- ✅ Création d'un onglet créatif personnalisé "Custom Ore Gen"
- KubeJS est maintenant une dépendance obligatoire (le mod refuse de se lancer sans KubeJS)
- ✅ Création automatique du script KubeJS de suppression des minerais vanilla au premier lancement
- ⚠️ (Anciennement 2.1.5) KubeJS n'est plus une dépendance : la suppression des minerais vanilla est désormais native (biome modifier NeoForge), à partir de la migration NeoForge 1.21.1
- ✅ Nouvelle texture Diamond Shard (32x32 pixels)
- ✅ Correction des textures d'armure (plus de texture violette)
- ✅ Désactivation du minerai Shard Diamond en surface (seulement la version deepslate reste disponible)
- ️ Le minerai Shard Diamond existe en deux variantes (surface Y 015 et deepslate Y -64 à -40), toutes deux générées partout et contrôlées par le toggle `shardDiamondOre`
- ✅ Amélioration du système de matériau d'armure avec `ShardDiamondArmorMaterial`
## Crédits
@@ -703,7 +665,7 @@ Custom Ore Gen est conçu pour :
- **Auteur** : Aulyrius
- **Outil de développement** : MCreator (https://mcreator.net/about)
- **Site web** : https://lanro.eu
- **Framework** : Minecraft Forge 1.20.1 (version 47.3.0)
- **Framework** : NeoForge 1.21.1 (version 21.1.219)
---
+114 -38
View File
@@ -1,54 +1,130 @@
plugins {
id 'java-library'
id 'eclipse'
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
id 'idea'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.123'
}
version = '2.1.12'
group = 'com.aulyrius.custom_ore_gen'
archivesBaseName = 'custom_ore_gen'
tasks.named('wrapper', Wrapper).configure {
distributionType = Wrapper.DistributionType.BIN
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
version = mod_version
group = mod_group_id
minecraft {
mappings channel: 'official', version: '1.20.1'
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
copyIdeResources = true
runs {
client {
def mcreatorJvmOptions = System.getenv('MCREATOR_JVM_OPTIONS')
if (mcreatorJvmOptions) {
jvmArgs += mcreatorJvmOptions.split("\\s+").findAll { it.trim() }.toList()
}
}
server {
}
configureEach {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main
}
}
}
repositories {
mavenLocal()
maven {
name = "Jared's maven"
url = "https://maven.blamejared.com/"
}
maven {
name = "ModMaven"
url = "https://modmaven.dev"
}
}
base {
archivesName = mod_id
}
// NeoForge requires Java 21 - Gradle will automatically download it if needed
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
neoForge {
version = project.neo_version
// Default run configurations.
runs {
client {
client()
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
server {
server()
programArgument '--nogui'
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
gameTestServer {
type = 'gameTestServer'
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
data {
data()
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
logLevel = org.slf4j.event.Level.DEBUG
}
}
mods {
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
// Expose Minecraft + NeoForge classes to the 'test' source set so that pure
// unit tests can assert on worldgen types (e.g. BiomeBand, Biomes, TagKey)
// without needing a full game server. This mirrors how the 'main' source set
// is configured by the plugin. Run with: ./gradlew test
addModdingDependenciesTo(sourceSets.test)
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
configurations {
runtimeClasspath.extendsFrom localRuntime
}
dependencies {
minecraft 'net.minecraftforge:forge:1.20.1-47.3.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation 'org.mockito:mockito-core:4.5.1'
testImplementation 'org.mockito:mockito-junit-jupiter:4.5.1'
}
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range : minecraft_version_range,
neo_version : neo_version,
neo_version_range : neo_version_range,
loader_version_range : loader_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : mod_version,
mod_authors : mod_authors,
mod_description : mod_description
]
inputs.properties replaceProperties
filesMatching(['META-INF/neoforge.mods.toml']) {
expand replaceProperties
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
options.encoding = 'UTF-8'
}
apply from: 'mcreator.gradle'
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}

Some files were not shown because too many files have changed in this diff Show More