Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build_status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions docs/ORE_GENERATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/zone/moddev/mc/basegems/worldgen/GemWorldgen.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ 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)
};

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");
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
{"id": "mineralogy:peridotite", "required": false},
{"id": "mineralogy:gabbro", "required": false}
]
}
20 changes: 20 additions & 0 deletions tools/verify_geology_defaults.py
Original file line number Diff line number Diff line change
@@ -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')
Loading