From a4ea27a1cede2472c2f212871bebcc90f55157ad Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Mon, 16 Nov 2026 11:19:59 +0000 Subject: [PATCH] Correct peridot and sapphire geological hosts --- .github/workflows/build_status.yml | 1 + CHANGELOG.txt | 6 ++++++ docs/ORE_GENERATION.md | 5 +++++ gradle.properties | 2 +- .../mc/basegems/worldgen/GemWorldgen.java | 16 +++++++++------ .../tags/block/ore_hosts/peridot.json | 7 +++++++ tools/verify_geology_defaults.py | 20 +++++++++++++++++++ 7 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/data/basegems/tags/block/ore_hosts/peridot.json create mode 100644 tools/verify_geology_defaults.py diff --git a/.github/workflows/build_status.yml b/.github/workflows/build_status.yml index 0803185..c7d9af8 100644 --- a/.github/workflows/build_status.yml +++ b/.github/workflows/build_status.yml @@ -39,6 +39,7 @@ jobs: - name: Build and test run: | chmod +x ./gradlew + python3 tools/verify_geology_defaults.py ./gradlew clean check build - name: Upload build artifacts diff --git a/CHANGELOG.txt b/CHANGELOG.txt index be06917..16b5de9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,9 @@ +4.0.1.121012 for Minecraft 1.21.1 + +- Let peridot use peridotite, gabbro and basalt, with optional Mineralogy hosts. +- Allow sapphire and violet sapphire in metamorphic as well as volcanic rocks. +- Keep gem depths, frequencies, vein sizes, drops and the other 30 gem rules unchanged. Saved profiles and pack overrides remain authoritative. + 4.0.0.121012 for Minecraft 1.21.1 All 33 gems come across to NeoForge 1.21.1. Use Java 21, NeoForge 21.1.265 or diff --git a/docs/ORE_GENERATION.md b/docs/ORE_GENERATION.md index 58ed70a..126870a 100644 --- a/docs/ORE_GENERATION.md +++ b/docs/ORE_GENERATION.md @@ -14,6 +14,11 @@ mining trip can turn up several types. | Metamorphic and volcanic deposits | Garnet, jade, iolite, alexandrite, spinel, tanzanite, ruby, sapphire, violet sapphire, peridot | Small clusters biased toward the bottom of their ranges. Garnet is relatively common. Ruby and sapphire mostly reward deeper mining. | | Black diamond | Black diamond | A single-block find at Y 5–16. Some candidates exposed to cave air are skipped. | +Peridot also accepts peridotite and gabbro through optional natural-rock tags; +sapphire and violet sapphire accept metamorphic as well as volcanic rocks. +Mineralogy is optional. These host corrections do not increase gem vein budgets. +Existing saved profiles and pack overrides remain authoritative; no retrogen is enabled. + The groupings draw on natural gemstone settings, including gem-rich pegmatites, marble-hosted ruby and spinel, and sediment-hosted amber and opal. Moldavite's shallow gravel placement represents redeposited impact glass. diff --git a/gradle.properties b/gradle.properties index a543538..80505bd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ # Example: 1.0.0. 1 21 01 2 notice the minecraft version hidden there at the end? # and the 2 means it's for NeoForge while 1 is Forge and I suspect if we did Fabric mods 3 would be for that. # (This also helps for bug reports as the version number gives us a clue as to what version of Minecraft the bug happened on) -mod_version = 4.0.0.121012 +mod_version = 4.0.1.121012 mod_name = Base Gems mod_id = basegems mod_archive_name = BaseGems diff --git a/src/main/java/zone/moddev/mc/basegems/worldgen/GemWorldgen.java b/src/main/java/zone/moddev/mc/basegems/worldgen/GemWorldgen.java index b2b2699..3bfb734 100644 --- a/src/main/java/zone/moddev/mc/basegems/worldgen/GemWorldgen.java +++ b/src/main/java/zone/moddev/mc/basegems/worldgen/GemWorldgen.java @@ -54,9 +54,9 @@ public final class GemWorldgen { new Deposit("spinel", Setting.METAMORPHIC, 8, 36, 0.11, 1, 2), new Deposit("tanzanite", Setting.METAMORPHIC, 10, 34, 0.045, 1, 2), new Deposit("ruby", Setting.METAMORPHIC, 6, 26, 0.095, 1, 2), - new Deposit("sapphire", Setting.VOLCANIC, 7, 33, 0.11, 1, 2), - new Deposit("violetsapphire", Setting.VOLCANIC, 6, 25, 0.045, 1, 2), - new Deposit("peridot", Setting.VOLCANIC, 9, 39, 0.18, 1, 3), + new Deposit("sapphire", Setting.CORUNDUM, 7, 33, 0.11, 1, 2), + new Deposit("violetsapphire", Setting.CORUNDUM, 6, 25, 0.045, 1, 2), + new Deposit("peridot", Setting.PERIDOT, 9, 39, 0.18, 1, 3), new Deposit("blackdiamond", Setting.DEEP, 5, 16, 0.035, 1, 1) }; @@ -64,7 +64,7 @@ private GemWorldgen() {} /** Hands the enabled deposits to OreSpawn; runs during {@code InterModEnqueueEvent}. */ public static void enqueue() { - WorldgenProvider.Builder provider = WorldgenProvider.builder(BaseGems.MOD_ID, 1); + WorldgenProvider.Builder provider = WorldgenProvider.builder(BaseGems.MOD_ID, 2); int count = 0; for (Deposit deposit : DEPOSITS) { ResourceLocation block = ResourceLocation.fromNamespaceAndPath(BaseGems.MOD_ID, deposit.name + "_ore"); @@ -99,8 +99,9 @@ private enum Setting { GeologyFamily.IGNEOUS_INTRUSIVE), METAMORPHIC(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 2, 1, 0.35, GeologyFamily.METAMORPHIC), - VOLCANIC(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 2, 1, 0.35, - GeologyFamily.IGNEOUS_VOLCANIC), + CORUNDUM(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 2, 1, 0.35, + GeologyFamily.METAMORPHIC, GeologyFamily.IGNEOUS_VOLCANIC), + PERIDOT(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 2, 1, 0.35), DEEP(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 1, 0, 0.60, GeologyFamily.IGNEOUS_VOLCANIC); @@ -128,6 +129,9 @@ void configure(WorldgenProvider.OreDimensionDefinition.Builder placement) { placement.hostBlock(DIRT).hostBlock(CLAY).hostBlock(SAND).hostBlock(GRAVEL); } else if (this == MOLDAVITE) { placement.hostBlock(GRAVEL).hostBlock(DIRT, 0.5); + } else if (this == PERIDOT) { + placement.hostBlock(STONE).hostBlock(vanilla("deepslate")).hostBlock(vanilla("basalt")) + .hostTag(ResourceLocation.fromNamespaceAndPath(BaseGems.MOD_ID, "ore_hosts/peridot")); } else { placement.hostBlock(STONE); for (GeologyFamily family : families) placement.hostFamily(family); diff --git a/src/main/resources/data/basegems/tags/block/ore_hosts/peridot.json b/src/main/resources/data/basegems/tags/block/ore_hosts/peridot.json new file mode 100644 index 0000000..c00088f --- /dev/null +++ b/src/main/resources/data/basegems/tags/block/ore_hosts/peridot.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + {"id": "mineralogy:peridotite", "required": false}, + {"id": "mineralogy:gabbro", "required": false} + ] +} diff --git a/tools/verify_geology_defaults.py b/tools/verify_geology_defaults.py new file mode 100644 index 0000000..d8381ea --- /dev/null +++ b/tools/verify_geology_defaults.py @@ -0,0 +1,20 @@ +"""Lightweight default-declaration contracts; generated-world tests stay local.""" +import json +import re +from pathlib import Path + +root = Path(__file__).resolve().parents[1] +source = (root / 'src/main/java/zone/moddev/mc/basegems/worldgen/GemWorldgen.java').read_text() +deposits = re.findall(r'new Deposit\("([a-z]+)", Setting\.([A-Z_]+), ([^)]+)\)', source) +assert len(deposits) == 33 +rules = {name: (setting, values) for name, setting, values in deposits} +assert rules['peridot'] == ('PERIDOT', '9, 39, 0.18, 1, 3') +assert rules['sapphire'] == ('CORUNDUM', '7, 33, 0.11, 1, 2') +assert rules['violetsapphire'] == ('CORUNDUM', '6, 25, 0.045, 1, 2') +assert 'GeologyFamily.METAMORPHIC, GeologyFamily.IGNEOUS_VOLCANIC' in source +assert '.hostBlock(vanilla("deepslate")).hostBlock(vanilla("basalt"))' in source +tag = json.loads((root / 'src/main/resources/data/basegems/tags/block/ore_hosts/peridot.json').read_text()) +assert {entry['id'] for entry in tag['values']} == {'mineralogy:peridotite', 'mineralogy:gabbro'} +assert all(entry['required'] is False for entry in tag['values']) +assert '.retrogen(false)' in source +print('Gem geology defaults: 33 rules, three corrected hosts, unchanged budgets, optional raw-rock tags passed')