Skip to content

Commit e48bb21

Browse files
authored
Merge pull request #27 from SkyBlade1978/feature/1.21.1-neo-geology-balance
Correct peridot and sapphire geological hosts
2 parents 2884fc5 + a4ea27a commit e48bb21

7 files changed

Lines changed: 50 additions & 7 deletions

File tree

‎.github/workflows/build_status.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
- name: Build and test
4040
run: |
4141
chmod +x ./gradlew
42+
python3 tools/verify_geology_defaults.py
4243
./gradlew clean check build
4344
4445
- name: Upload build artifacts

‎CHANGELOG.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
4.0.1.121012 for Minecraft 1.21.1
2+
3+
- Let peridot use peridotite, gabbro and basalt, with optional Mineralogy hosts.
4+
- Allow sapphire and violet sapphire in metamorphic as well as volcanic rocks.
5+
- Keep gem depths, frequencies, vein sizes, drops and the other 30 gem rules unchanged. Saved profiles and pack overrides remain authoritative.
6+
17
4.0.0.121012 for Minecraft 1.21.1
28

39
All 33 gems come across to NeoForge 1.21.1. Use Java 21, NeoForge 21.1.265 or

‎docs/ORE_GENERATION.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ mining trip can turn up several types.
1414
| 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. |
1515
| Black diamond | Black diamond | A single-block find at Y 5–16. Some candidates exposed to cave air are skipped. |
1616

17+
Peridot also accepts peridotite and gabbro through optional natural-rock tags;
18+
sapphire and violet sapphire accept metamorphic as well as volcanic rocks.
19+
Mineralogy is optional. These host corrections do not increase gem vein budgets.
20+
Existing saved profiles and pack overrides remain authoritative; no retrogen is enabled.
21+
1722
The groupings draw on natural gemstone settings, including gem-rich
1823
pegmatites, marble-hosted ruby and spinel, and sediment-hosted amber and opal.
1924
Moldavite's shallow gravel placement represents redeposited impact glass.

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Example: 1.0.0. 1 21 01 2 notice the minecraft version hidden there at the end?
44
# 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.
55
# (This also helps for bug reports as the version number gives us a clue as to what version of Minecraft the bug happened on)
6-
mod_version = 4.0.0.121012
6+
mod_version = 4.0.1.121012
77
mod_name = Base Gems
88
mod_id = basegems
99
mod_archive_name = BaseGems

‎src/main/java/zone/moddev/mc/basegems/worldgen/GemWorldgen.java‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ public final class GemWorldgen {
5454
new Deposit("spinel", Setting.METAMORPHIC, 8, 36, 0.11, 1, 2),
5555
new Deposit("tanzanite", Setting.METAMORPHIC, 10, 34, 0.045, 1, 2),
5656
new Deposit("ruby", Setting.METAMORPHIC, 6, 26, 0.095, 1, 2),
57-
new Deposit("sapphire", Setting.VOLCANIC, 7, 33, 0.11, 1, 2),
58-
new Deposit("violetsapphire", Setting.VOLCANIC, 6, 25, 0.045, 1, 2),
59-
new Deposit("peridot", Setting.VOLCANIC, 9, 39, 0.18, 1, 3),
57+
new Deposit("sapphire", Setting.CORUNDUM, 7, 33, 0.11, 1, 2),
58+
new Deposit("violetsapphire", Setting.CORUNDUM, 6, 25, 0.045, 1, 2),
59+
new Deposit("peridot", Setting.PERIDOT, 9, 39, 0.18, 1, 3),
6060
new Deposit("blackdiamond", Setting.DEEP, 5, 16, 0.035, 1, 1)
6161
};
6262

6363
private GemWorldgen() {}
6464

6565
/** Hands the enabled deposits to OreSpawn; runs during {@code InterModEnqueueEvent}. */
6666
public static void enqueue() {
67-
WorldgenProvider.Builder provider = WorldgenProvider.builder(BaseGems.MOD_ID, 1);
67+
WorldgenProvider.Builder provider = WorldgenProvider.builder(BaseGems.MOD_ID, 2);
6868
int count = 0;
6969
for (Deposit deposit : DEPOSITS) {
7070
ResourceLocation block = ResourceLocation.fromNamespaceAndPath(BaseGems.MOD_ID, deposit.name + "_ore");
@@ -99,8 +99,9 @@ private enum Setting {
9999
GeologyFamily.IGNEOUS_INTRUSIVE),
100100
METAMORPHIC(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 2, 1, 0.35,
101101
GeologyFamily.METAMORPHIC),
102-
VOLCANIC(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 2, 1, 0.35,
103-
GeologyFamily.IGNEOUS_VOLCANIC),
102+
CORUNDUM(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 2, 1, 0.35,
103+
GeologyFamily.METAMORPHIC, GeologyFamily.IGNEOUS_VOLCANIC),
104+
PERIDOT(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 2, 1, 0.35),
104105
DEEP(OrePattern.CLUSTERS, OreHeightDistribution.BOTTOM_TRIANGLE, 1, 0, 0.60,
105106
GeologyFamily.IGNEOUS_VOLCANIC);
106107

@@ -128,6 +129,9 @@ void configure(WorldgenProvider.OreDimensionDefinition.Builder placement) {
128129
placement.hostBlock(DIRT).hostBlock(CLAY).hostBlock(SAND).hostBlock(GRAVEL);
129130
} else if (this == MOLDAVITE) {
130131
placement.hostBlock(GRAVEL).hostBlock(DIRT, 0.5);
132+
} else if (this == PERIDOT) {
133+
placement.hostBlock(STONE).hostBlock(vanilla("deepslate")).hostBlock(vanilla("basalt"))
134+
.hostTag(ResourceLocation.fromNamespaceAndPath(BaseGems.MOD_ID, "ore_hosts/peridot"));
131135
} else {
132136
placement.hostBlock(STONE);
133137
for (GeologyFamily family : families) placement.hostFamily(family);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"replace": false,
3+
"values": [
4+
{"id": "mineralogy:peridotite", "required": false},
5+
{"id": "mineralogy:gabbro", "required": false}
6+
]
7+
}

‎tools/verify_geology_defaults.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""Lightweight default-declaration contracts; generated-world tests stay local."""
2+
import json
3+
import re
4+
from pathlib import Path
5+
6+
root = Path(__file__).resolve().parents[1]
7+
source = (root / 'src/main/java/zone/moddev/mc/basegems/worldgen/GemWorldgen.java').read_text()
8+
deposits = re.findall(r'new Deposit\("([a-z]+)", Setting\.([A-Z_]+), ([^)]+)\)', source)
9+
assert len(deposits) == 33
10+
rules = {name: (setting, values) for name, setting, values in deposits}
11+
assert rules['peridot'] == ('PERIDOT', '9, 39, 0.18, 1, 3')
12+
assert rules['sapphire'] == ('CORUNDUM', '7, 33, 0.11, 1, 2')
13+
assert rules['violetsapphire'] == ('CORUNDUM', '6, 25, 0.045, 1, 2')
14+
assert 'GeologyFamily.METAMORPHIC, GeologyFamily.IGNEOUS_VOLCANIC' in source
15+
assert '.hostBlock(vanilla("deepslate")).hostBlock(vanilla("basalt"))' in source
16+
tag = json.loads((root / 'src/main/resources/data/basegems/tags/block/ore_hosts/peridot.json').read_text())
17+
assert {entry['id'] for entry in tag['values']} == {'mineralogy:peridotite', 'mineralogy:gabbro'}
18+
assert all(entry['required'] is False for entry in tag['values'])
19+
assert '.retrogen(false)' in source
20+
print('Gem geology defaults: 33 rules, three corrected hosts, unchanged budgets, optional raw-rock tags passed')

0 commit comments

Comments
 (0)