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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ jobs:
if-no-files-found: error
retention-days: 30
path: |
build/libs/RealisticDeposits-0.5.0.110021.jar
build/libs/RealisticDeposits-0.5.0.110021-sources.jar
build/libs/RealisticDeposits-0.5.0.110021-javadoc.jar
build/libs/RealisticDeposits-0.6.0.110021.jar
build/libs/RealisticDeposits-0.6.0.110021-sources.jar
build/libs/RealisticDeposits-0.6.0.110021-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.md

Expand Down
69 changes: 61 additions & 8 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Release Realistic Deposits

run-name: Release RealisticDeposits ${{ inputs.release_version }} (CurseForge ${{ inputs.curseforge_release_level }})
run-name: Release RealisticDeposits ${{ inputs.release_version }} (${{ inputs.mode }}, ${{ inputs.publication_scope }}, CurseForge ${{ inputs.curseforge_release_level }})

on:
workflow_dispatch:
Expand All @@ -26,8 +26,16 @@ on:
- release
- beta
- alpha
publication_scope:
description: Publish to all release destinations or to CurseForge only.
required: true
default: all
type: choice
options:
- all
- curseforge-only
confirm_live_publication:
description: Confirm publication to Maven, CurseForge, and GitHub after the build passes.
description: Confirm live publication to the selected destinations after the build passes.
required: true
default: false
type: boolean
Expand Down Expand Up @@ -141,6 +149,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
REQUESTED_VERSION: ${{ inputs.release_version }}
PUBLICATION_SCOPE: ${{ inputs.publication_scope }}
run: |
set -euo pipefail

Expand Down Expand Up @@ -248,6 +257,11 @@ jobs:
fi

release_sha="$(git rev-parse HEAD)"
if [[ "$PUBLICATION_SCOPE" == "curseforge-only" ]] &&
[[ "$GITHUB_REF" != "refs/heads/${{ steps.route.outputs.target_branch }}" || "$release_sha" != "$GITHUB_SHA" ]]; then
echo "CurseForge-only releases must run on the current target branch commit." >&2
exit 1
fi
release_tag="$release_version"
echo "release_sha=$release_sha" >> "$GITHUB_OUTPUT"
echo "release_version=$release_version" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -419,6 +433,7 @@ jobs:
env:
RELEASE_BRANCH: ${{ needs.preflight.outputs.target_branch }}
RELEASE_LEVEL: ${{ inputs.curseforge_release_level }}
PUBLICATION_SCOPE: ${{ inputs.publication_scope }}
RELEASE_SHA: ${{ needs.preflight.outputs.release_sha }}
RELEASE_VERSION: ${{ needs.preflight.outputs.release_version }}
run: |
Expand All @@ -429,7 +444,10 @@ jobs:
echo "- Target branch: \`$RELEASE_BRANCH\`"
echo "- Commit: \`$RELEASE_SHA\`"
echo "- CurseForge release level: \`$RELEASE_LEVEL\`"
echo "- GitHub Release type: prerelease"
echo "- Publication scope: \`$PUBLICATION_SCOPE\`"
if [[ "$PUBLICATION_SCOPE" == "all" ]]; then
echo "- GitHub Release type: prerelease"
fi
echo
echo "### Public artifact checksums"
echo '```text'
Expand All @@ -449,19 +467,32 @@ jobs:
- name: Confirm publication and release-secret access
env:
CONFIRM_LIVE_PUBLICATION: ${{ inputs.confirm_live_publication }}
PUBLICATION_SCOPE: ${{ inputs.publication_scope }}
EXPECTED_CHECKSUMS_SHA256: ${{ inputs.expected_checksums_sha256 }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
MAVEN_UPLOAD_URL: ${{ inputs.publication_scope == 'all' && secrets.MAVEN_UPLOAD_URL || '' }}
MAVEN_UPLOAD_USERNAME: ${{ inputs.publication_scope == 'all' && secrets.MAVEN_UPLOAD_USERNAME || '' }}
MAVEN_UPLOAD_PASSWORD: ${{ inputs.publication_scope == 'all' && secrets.MAVEN_UPLOAD_PASSWORD || '' }}
run: |
set -euo pipefail
if [[ "$CONFIRM_LIVE_PUBLICATION" != "true" ]]; then
echo "Confirm live publication in the workflow form before releasing ${{ needs.preflight.outputs.release_tag }}" >&2
exit 1
fi
echo "Live publication confirmed for ${{ needs.preflight.outputs.release_tag }}"
required=(CURSEFORGE_TOKEN)
case "$PUBLICATION_SCOPE" in
all) required+=(MAVEN_UPLOAD_URL MAVEN_UPLOAD_USERNAME MAVEN_UPLOAD_PASSWORD) ;;
curseforge-only)
if [[ ! "$EXPECTED_CHECKSUMS_SHA256" =~ ^[0-9a-fA-F]{64}$ ]]; then
echo "CurseForge-only publication requires the verified validation manifest SHA-256." >&2
exit 1
fi
;;
*) echo "Unknown publication scope." >&2; exit 1 ;;
esac
missing=()
for name in CURSEFORGE_TOKEN MAVEN_UPLOAD_URL MAVEN_UPLOAD_USERNAME MAVEN_UPLOAD_PASSWORD; do
for name in "${required[@]}"; do
if [[ -z "${!name:-}" ]]; then
missing+=("$name")
fi
Expand All @@ -470,10 +501,11 @@ jobs:
printf 'Required release secret is unavailable: %s\n' "${missing[@]}" >&2
exit 1
fi
echo "All four required release secrets are available."
echo "The required secrets for the selected scope are available."

create_release_tag:
name: Create validated release tag
if: inputs.mode == 'publish' && inputs.publication_scope == 'all'
needs:
- preflight
- build
Expand Down Expand Up @@ -515,6 +547,7 @@ jobs:

publish_maven:
name: Publish Maven
if: inputs.mode == 'publish' && inputs.publication_scope == 'all'
needs:
- preflight
- build
Expand Down Expand Up @@ -620,9 +653,16 @@ jobs:

publish_curseforge:
name: Publish CurseForge
if: >-
${{ !cancelled() && inputs.mode == 'publish' &&
needs.preflight.result == 'success' && needs.build.result == 'success' &&
needs.release_confirmation.result == 'success' &&
((inputs.publication_scope == 'curseforge-only' && needs.publish_maven.result == 'skipped') ||
(inputs.publication_scope == 'all' && needs.publish_maven.result == 'success')) }}
needs:
- preflight
- build
- release_confirmation
- publish_maven
runs-on: ubuntu-latest
timeout-minutes: 20
Expand All @@ -646,6 +686,7 @@ jobs:
fi

- name: Publish RealisticDeposits
id: curseforge
uses: Kira-NT/mc-publish@52307b03863581dec6b652b83e597aec02ebb075 # v3.3.1
with:
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
Expand All @@ -666,8 +707,20 @@ jobs:
${{ runner.temp }}/release-input/${{ needs.preflight.outputs.sources_jar }}
${{ runner.temp }}/release-input/${{ needs.preflight.outputs.javadoc_jar }}

- name: Record CurseForge upload receipt
env:
CURSEFORGE_FILE_ID: ${{ steps.curseforge.outputs.curseforge-version }}
run: |
if [[ "$CURSEFORGE_FILE_ID" =~ ^[0-9]+$ ]]; then
receipt="CurseForge accepted upload (file ID: $CURSEFORGE_FILE_ID)."
else
receipt="CurseForge upload succeeded; the publishing action did not return a numeric file ID."
fi
printf '%s\n' "$receipt" | tee -a "$GITHUB_STEP_SUMMARY"

publish_github:
name: Publish GitHub Release
if: inputs.mode == 'publish' && inputs.publication_scope == 'all'
needs:
- preflight
- build
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 0.6.0.110021

Beta for Minecraft 1.10.2.

- Require MMD OreSpawn 4.1.6.110021 or newer in the 4.x line.
- Add rare emerald pockets in mountain-belt geology, with natural schist
when Mineralogy strata are active and natural vanilla stone otherwise.
- Keep all ordinary emerald generation by default, with vanilla drops,
Fortune and Silk Touch.
- Small emerald finds contain 25–60 planned ore blocks. Rare larger finds
can contain 70–120 across more pockets. A thin pale-rock trace helps you
follow the trend between pockets without turning it into an ore seam.
- Keep a single short crosscut at small finds. Larger finds can have
linked galleries leading to multiple pockets. Only build an entrance
where the whole route is safe, without cutting into the emeralds.
- Add exceptional emerald mines with 260–420 planned ore blocks in four or
five zones. Starter workings can expose two pockets, with pale rock traces
to follow into unworked zones. Small and rich finds keep their previous layouts.
Existing worlds and mine layouts are unchanged.

## 0.5.0.110021

Alpha for Minecraft 1.10.2.
Expand Down
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

Realistic Deposits makes finding ore a reason to explore, then build a proper
mine. Rare iron districts, layered coalfields, diamond pipes, gold veins and
lapis lenses give you deposits worth returning to, with old workings leading
into some of them.
lapis lenses and emerald pockets give you deposits worth returning to, with
old workings leading into some of them.
Small pockets of diamond- and gold-bearing river gravel offer another way to prospect.
It runs on [MMD OreSpawn](https://github.com/MinecraftModDevelopmentMods/OreSpawn).

The project starts with Minecraft 1.10.2 and is intended to follow the
maintained OreSpawn branches across Forge and NeoForge.

Version 0.5.0.110021 is an alpha for Minecraft 1.10.2. It adds rare, compact
lapis lenses and short abandoned workings, with 15% of ordinary background
lapis retained by default. Try a fresh world to see the new rules: existing
Version 0.6.0.110021 is a local candidate for Minecraft 1.10.2. It adds rare
emerald pockets and occasional abandoned workings without reducing ordinary
emerald generation. Try a fresh world to see the new rules: existing
worlds keep their settings, generated chunks and saved mine layouts. Back up
important worlds before updating.

Expand All @@ -44,15 +44,21 @@ important worlds before updating.
- Compact lapis lenses with richer pockets and short workings. Natural marble
hosts them when Mineralogy strata are active; ordinary stone is used otherwise.
See [lapis deposits](docs/LAPIS.md).
- Rare emerald pockets along pale underground traces, with occasional larger
finds whose abandoned galleries can reach more than one pocket. Large
mines have several separated zones to prospect beyond the starter workings. They fit
natural schist in active Mineralogy strata, or natural vanilla stone
variants otherwise.
See [emerald deposits](docs/EMERALDS.md).
- Configurable support for vanilla and modded resources.
- Safe generation that avoids air, fluids, bedrock, block entities, structures,
and undeclared host blocks.
- Live reload for iron and coal geometry. Lapis, gold, diamond and other structural
- Live reload for iron and coal geometry. Emerald, lapis, gold, diamond and other structural
changes wait until restart.
- An entry in both Forge's Mods configuration and OreSpawn's World Settings.
- Abandoned workings with sloping, stepped entrances and short underground galleries.
New defaults attempt them at every iron formation, coalfield, diamond pipe
and goldfield, plus each lapis district, where safe. River placers stay untouched.
and goldfield, plus each lapis or emerald district, where safe. River placers stay untouched.
See the [mine settings](docs/ABANDONED_MINES.md).

Coalfields can already use Mineralogy's existing shale, siltstone and
Expand All @@ -65,7 +71,7 @@ The current branch requires:

- Minecraft 1.10.2;
- Forge 12.18.3.2511 or a compatible newer Forge 12 build;
- [MMD OreSpawn 4.1.5.110021](https://www.curseforge.com/minecraft/mc-mods/mmd-orespawn/files/9397156)
- [MMD OreSpawn 4.1.6.110021](https://www.curseforge.com/minecraft/mc-mods/mmd-orespawn/files/9518063)
or a newer compatible 1.10.2 release, but earlier than OreSpawn 5;
- Java 8 to run Minecraft.

Expand All @@ -83,6 +89,7 @@ config/realisticdeposits/deposits/coal.json
config/realisticdeposits/deposits/diamonds.json
config/realisticdeposits/deposits/gold.json
config/realisticdeposits/deposits/lapis.json
config/realisticdeposits/deposits/emerald.json
```

The supplied definition describes one rare iron district using a 640–960 block
Expand Down Expand Up @@ -160,7 +167,7 @@ formations:

`reload` requires operator permission. For iron and coal it applies `enabled`,
selection, shape, height, geome, family, and alignment changes. Diamond geometry
and source links require a restart, as do gold and lapis settings. Resource,
and source links require a restart, as do gold, lapis and emerald settings. Resource,
dimension, host, biome-filter, interaction-policy, scale, added, and removed
definition changes are structural and take effect after restart. Abandoned-mine
settings are also captured with the world's deposit definition. New provider
Expand All @@ -175,9 +182,9 @@ World Settings screen.
The Gradle build runs on Java 17 and compiles the mod for Java 8 using the
configured toolchain. ForgeGradle's Minecraft preparation utility uses Java 25.

OreSpawn 4.1.5.110021 is downloaded from Curse Maven, checked against its
OreSpawn 4.1.6.110021 is downloaded from Curse Maven, checked against its
official checksum and mapped for development automatically. The exact dependency
is `curse.maven:mmd-orespawn-245586:9397156`. No sibling checkout, local jar or
is `curse.maven:mmd-orespawn-245586:9518063`. No sibling checkout, local jar or
`local.properties` file is needed.

An optional local-candidate override is still available for development, but it
Expand Down Expand Up @@ -205,6 +212,7 @@ separate Eclipse profile and disposable saves for the new workings.
For coalfields, use `prepareCoalMeasuresManual` and the
[coal-testing walkthrough](tools/qualification/COAL_TESTING.md).
For lapis, see the [lapis walkthrough](tools/qualification/LAPIS_TESTING.md).
For emeralds, see the [emerald walkthrough](tools/qualification/EMERALD_TESTING.md).

Hosted CI/CD keeps to builds, unit/helper tests, static checks, reproducible
jars, dependency hashes and ordinary Eclipse launch definitions. It does not
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,11 @@ tasks.register('verifyProjectIdentity') {
}
if (project.minecraft_version != '1.10.2'
|| project.forge_version != '12.18.3.2511'
|| project.orespawn_version != '4.1.5.110021'
|| project.orespawn_version_range != '[4.1.5.110021,5.0.0)'
|| (!oreSpawnCandidateMode && oreSpawnCoordinate != 'curse.maven:mmd-orespawn-245586:9397156')
|| project.orespawn_version != '4.1.6.110021'
|| project.orespawn_version_range != '[4.1.6.110021,5.0.0)'
|| (!oreSpawnCandidateMode && oreSpawnCoordinate != 'curse.maven:mmd-orespawn-245586:9518063')
|| project.orespawn_sha256
!= '1E580EBB8D93B1256E2E81C7D0D815DEAAAC58A028CB5A77A52773B62048E010') {
!= '05DB7CBFAADC815D6A713DACDFB9F0647BCED49CCFC357FB2FF010E95BD1379F') {
throw new GradleException('Unexpected target or OreSpawn dependency identity')
}
if (project.mod_version.toString().contains('-')) {
Expand Down Expand Up @@ -650,3 +650,4 @@ apply from: 'gradle/coal-manual.gradle'
apply from: 'gradle/diamond-manual.gradle'
apply from: 'gradle/gold-manual.gradle'
apply from: 'gradle/lapis-manual.gradle'
apply from: 'gradle/emerald-manual.gradle'
61 changes: 61 additions & 0 deletions docs/EMERALDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Finding emerald pockets

Rare underground deposits follow a short vein trend through OreSpawn's
mountain-belt geology. The surface biome doesn't need to be a mountain.
Most finds have two to four separated pockets, with 25–60 planned ore
blocks along a 24–48 block trend. A rich find can have four to six pockets
and 70–120 planned blocks along a 52–80 block trend. A large
mine has 260–420 planned blocks in four or five separated zones along a
120–168 block trend. Each zone has two pockets, with barren rock between
zones. A pale, narrow trace of diorite points onward without adding
emeralds to the gaps.
Caves, changes in host rock and protected features can interrupt the trace
or reduce the ore you find. The ore has normal vanilla drops, Fortune and
Silk Touch.

The inspiration is the vein-adjacent mineralisation of the
[Kafubu emerald district](https://repository.naturalis.nl/pub/801803).
Active Mineralogy strata use only enabled, natural schist. If the host is
missing, the deposit is skipped. Without physical strata, natural vanilla
stone variants are a simpler approximation. Unclassified geology and
unsupported terrain are skipped rather than guessing or loading new chunks.

A compact stepped descent and one short crosscut can expose a small pocket.
Rich and large finds can have timbered galleries leading from a single
stairway to two or more pockets. In a large mine these are starter workings:
follow the diorite out of the worked zone and dig your own headings into
the other zones. The complete starter workings must fit in one fresh chunk so the
game can check the route before carving. If the galleries cannot reach two
actual pockets, or if water, infested stone or a structure makes the route
unsafe, a large mine may try another route in that same chunk. If none fits
safely, the deposit can still generate without an entrance. Pockets beyond
the workings are left for prospecting.

The fresh defaults use a 35% selection chance per 64-chunk region before
geology and host checks, at Y12–48 and with at least eight blocks of cover.
Eight percent of candidates that reach the layout stage try the larger
layout. If that does not fit the mountain-belt geology and eligible host,
the generator tries the ordinary layout instead. Large mines have a
separate 8% roll, only in regions not selected for small or rich finds.
They remain more geographically restricted than iron formations; all
their zones must fit the mountain-belt geology and eligible host rock. These are gameplay
ranges for individual finds, not estimates of a real mine's production.
The default additive mode does not scale down or replace ordinary emerald
rules. Pack authors can opt into hybrid or replacement mode.

Settings are in `config/realisticdeposits/deposits/emerald.json`. Restart
after changes. The optional `shape.rich_find` sets the chance, pocket count,
strike and ore budget for larger finds. `shape.rich_find.workings` enables
the linked galleries, subject to the ordinary abandoned-mine setting.
`shape.vein_trace` enables the non-ore cue for small and rich finds.
The optional `shape.large_mine` sets the large-mine chance, zone count,
strike and ore budget. Large mines always plan their own prospecting clues;
the ordinary abandoned-mine setting still controls their starter workings.
Leave `shape.large_mine` absent to keep the two-tier layout. Older catalogues
without these fields and existing world
profiles keep their previous settings. Generated chunks are never rewritten.
Preview a catalogue candidate without writing blocks:

```text
/realisticdeposits preview <regionX> <regionZ> realisticdeposits:overworld_emerald_pockets
```
Loading
Loading