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
52 changes: 52 additions & 0 deletions .github/test-base-metals-pin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
set -euo pipefail

verify="$(cd "$(dirname "$0")" && pwd)/verify-base-metals-pin.sh"
temporary_root="$(cd "${TMPDIR:-/tmp}" && pwd -P)"
scratch="$(mktemp -d "$temporary_root/basepower-pin.XXXXXXXX")"
cleanup() {
local resolved
resolved="$(cd "$scratch" && pwd -P)"
case "$resolved" in
"$temporary_root"/basepower-pin.*) rm -rf -- "$resolved" ;;
*) echo 'Refusing to clear an unexpected test directory' >&2; return 1 ;;
esac
}
trap cleanup EXIT
mkdir -p "$scratch/bin" "$scratch/project"
cat > "$scratch/bin/gh" <<'MOCK'
#!/usr/bin/env bash
set -euo pipefail
[[ "$#" == 4 && "$1" == api && "$2" == "$EXPECTED_COMPARE" && "$3" == --jq && "$4" == .status ]]
printf '%s\n' "$PIN_STATUS"
MOCK
chmod +x "$scratch/bin/gh"
export PATH="$scratch/bin:$PATH"
commit=1111111111111111111111111111111111111111
cd "$scratch/project"
for minecraft in 1.20.6 1.21.1 1.21.11; do
printf 'minecraft_version=%s\nbasemetals_source_commit=%s\n' "$minecraft" "$commit" > gradle.properties
export EXPECTED_COMPARE="repos/MinecraftModDevelopmentMods/BaseMetals/compare/$commit...master-$minecraft"
export GITHUB_OUTPUT="$scratch/output"
for PIN_STATUS in identical ahead; do
export PIN_STATUS
: > "$GITHUB_OUTPUT"
bash "$verify"
grep -qx "commit=$commit" "$GITHUB_OUTPUT"
done
for PIN_STATUS in behind diverged; do
export PIN_STATUS
: > "$GITHUB_OUTPUT"
if bash "$verify" > "$scratch/rejected.log" 2>&1; then
echo "Incorrectly accepted $minecraft / $PIN_STATUS" >&2
exit 1
fi
test ! -s "$GITHUB_OUTPUT"
done
done
printf 'minecraft_version=invalid\nbasemetals_source_commit=%s\n' "$commit" > gradle.properties
if bash "$verify" > "$scratch/invalid.log" 2>&1; then
echo 'Incorrectly accepted an invalid target' >&2
exit 1
fi
echo 'PASS: target-derived Base Metals ancestry guards and rejection controls'
7 changes: 6 additions & 1 deletion .github/verify-base-metals-pin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ if [[ ! "$commit" =~ ^[0-9a-f]{40}$ ]]; then
exit 1
fi

branch=master-1.20.6
minecraft="$(sed -n 's/^minecraft_version=//p' gradle.properties)"
if [[ ! "$minecraft" =~ ^1\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Expected a complete Minecraft target version in gradle.properties"
exit 1
fi
branch="master-$minecraft"
if ! status="$(gh api "repos/MinecraftModDevelopmentMods/BaseMetals/compare/$commit...$branch" --jq '.status')"; then
echo "::error::Could not verify Base Metals $commit on upstream $branch"
exit 1
Expand Down
37 changes: 19 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: basePower 1.20.6 CI
name: basePower 1.21.1 CI

on:
push:
branches: [master-1.20.6, 'feature/**']
branches: [master-1.21.1, 'feature/**']
pull_request:
branches: [master-1.20.6]
branches: [master-1.21.1]

permissions:
contents: read

concurrency:
group: basepower-1.20.6-${{ github.workflow }}-${{ github.ref }}
group: basepower-1.21.1-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -21,7 +21,9 @@ jobs:
steps:
- name: Check out PowerAdvantage
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Require the Base Metals pin on upstream master-1.20.6
- name: Test target-derived dependency guards
run: bash .github/test-base-metals-pin.sh
- name: Require the Base Metals pin on upstream master-1.21.1
id: base-metals-pin
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -32,13 +34,13 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: MinecraftModDevelopmentMods/OreSpawn
ref: 4085315345ff043448b316d75e03f4b8da45402d
ref: 62c08169c71f4d4fd8f107289e63fd2a4c7c655c
path: .ci-dependencies/OreSpawn
- name: Check out pinned Base Metals
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: MinecraftModDevelopmentMods/BaseMetals
ref: 9e706db5c85fa2bc7f36dee94f39a5f2fa8ab367
ref: 327c197bcdd0bb5e883d844bb6a6c8791bc580b7
path: .ci-dependencies/BaseMetals
- name: Install pinned Java 25 Mavenizer runtime
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
Expand Down Expand Up @@ -74,11 +76,10 @@ jobs:
mavenizer="$orespawn/ci-fixtures/tools/minecraft-mavenizer-0.5.21-orespawn-compat.jar"
mirror="$RUNNER_TEMP/orespawn-mirror"
(cd "$basemetals" && bash gradle/stage-orespawn-release.sh "$mirror")
chmod +x "$orespawn/gradlew" "$basemetals/gradlew"
(cd "$orespawn" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar --no-daemon --stacktrace)
(cd "$basemetals" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar -PorespawnVerificationRepository="$mirror" --no-daemon --stacktrace)
osjar="$orespawn/build/libs/OreSpawn-4.1.0.120061.jar"
bmjar="$basemetals/build/libs/BaseMetals-3.1.2.120061.jar"
(cd "$orespawn" && bash gradlew $MMD_GRADLE_TOOLCHAINS jar --no-daemon --stacktrace)
(cd "$basemetals" && bash gradlew $MMD_GRADLE_TOOLCHAINS jar -PorespawnVerificationRepository="$mirror" --no-daemon --stacktrace)
osjar="$orespawn/build/libs/OreSpawn-4.1.0.121011.jar"
bmjar="$basemetals/build/libs/BaseMetals-3.1.2.121011.jar"
test -f "$osjar" && test -f "$bmjar"
echo "orespawn=$osjar" >> "$GITHUB_OUTPUT"
echo "basemetals=$bmjar" >> "$GITHUB_OUTPUT"
Expand All @@ -89,25 +90,25 @@ jobs:
writeReleaseChecksums verifyEclipseProductionClasspath
-PbaseMetalsDeobfJar=${{ steps.dependencies.outputs.basemetals }}
-PoreSpawnDeobfJar=${{ steps.dependencies.outputs.orespawn }}
-Pforge50MavenizerJar=${{ steps.dependencies.outputs.mavenizer }}
-Pforge52MavenizerJar=${{ steps.dependencies.outputs.mavenizer }}
--no-daemon --stacktrace
- name: Upload audited release candidate
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: basePower-1.20.6-${{ github.sha }}
name: basePower-1.21.1-${{ github.sha }}
if-no-files-found: error
retention-days: 30
path: |
build/libs/basePower-2.4.13.120061.jar
build/libs/basePower-2.4.13.120061-sources.jar
build/libs/basePower-2.4.13.120061-javadoc.jar
build/libs/basePower-2.4.14.121011.jar
build/libs/basePower-2.4.14.121011-sources.jar
build/libs/basePower-2.4.14.121011-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.txt
- name: Upload diagnostics on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: basePower-1.20.6-diagnostics-${{ github.sha }}
name: basePower-1.21.1-diagnostics-${{ github.sha }}
if-no-files-found: ignore
retention-days: 14
path: |
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CodeQL

on:
push:
branches: [master-1.20.6, 'feature/**']
branches: [master-1.21.1, 'feature/**']
pull_request:
branches: [master-1.20.6]
branches: [master-1.21.1]
schedule:
- cron: '47 7 * * 4'

Expand All @@ -21,7 +21,9 @@ jobs:
steps:
- name: Check out PowerAdvantage
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Require the Base Metals pin on upstream master-1.20.6
- name: Test target-derived dependency guards
run: bash .github/test-base-metals-pin.sh
- name: Require the Base Metals pin on upstream master-1.21.1
id: base-metals-pin
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -32,13 +34,13 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: MinecraftModDevelopmentMods/OreSpawn
ref: 4085315345ff043448b316d75e03f4b8da45402d
ref: 62c08169c71f4d4fd8f107289e63fd2a4c7c655c
path: .ci-dependencies/OreSpawn
- name: Check out pinned Base Metals
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: MinecraftModDevelopmentMods/BaseMetals
ref: 9e706db5c85fa2bc7f36dee94f39a5f2fa8ab367
ref: 327c197bcdd0bb5e883d844bb6a6c8791bc580b7
path: .ci-dependencies/BaseMetals
- name: Install pinned Java 25 Mavenizer runtime
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
Expand Down Expand Up @@ -77,8 +79,8 @@ jobs:
chmod +x "$orespawn/gradlew" "$basemetals/gradlew"
(cd "$orespawn" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar --no-daemon --stacktrace)
(cd "$basemetals" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar -PorespawnVerificationRepository="$mirror" --no-daemon --stacktrace)
echo "orespawn=$orespawn/build/libs/OreSpawn-4.1.0.120061.jar" >> "$GITHUB_OUTPUT"
echo "basemetals=$basemetals/build/libs/BaseMetals-3.1.2.120061.jar" >> "$GITHUB_OUTPUT"
echo "orespawn=$orespawn/build/libs/OreSpawn-4.1.0.121011.jar" >> "$GITHUB_OUTPUT"
echo "basemetals=$basemetals/build/libs/BaseMetals-3.1.2.121011.jar" >> "$GITHUB_OUTPUT"
echo "mavenizer=$mavenizer" >> "$GITHUB_OUTPUT"
- name: Initialize CodeQL
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
Expand All @@ -91,6 +93,6 @@ jobs:
./gradlew $MMD_GRADLE_TOOLCHAINS clean classes verifyReleaseDependencies --rerun-tasks --no-build-cache --no-daemon --stacktrace \
-PbaseMetalsDeobfJar=${{ steps.dependencies.outputs.basemetals }} \
-PoreSpawnDeobfJar=${{ steps.dependencies.outputs.orespawn }} \
-Pforge50MavenizerJar=${{ steps.dependencies.outputs.mavenizer }}
-Pforge52MavenizerJar=${{ steps.dependencies.outputs.mavenizer }}
- name: Analyze
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
4 changes: 2 additions & 2 deletions .github/workflows/validate-gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Validate Gradle Wrapper
on:
push:
branches:
- master-1.20.6
- master-1.21.1
- 'feature/**'
pull_request:
branches:
- master-1.20.6
- master-1.21.1

permissions:
contents: read
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
basePower 2.4.14.121011 (Minecraft 1.21.1)

- Bring basePower to Forge 52 and Java 21, keeping existing blocks, items and machine data.
- Use the new recipe, advancement, loot and tag folders without changing their in-game names.
- Update fluid gauges to the current renderer while keeping the full texture visible.
- Preserve custom attributes on old modded entities when Minecraft upgrades their save format.
- Handle the new data-driven painting and enchantment registries when upgrading 1.20.6 worlds. Keep a recovery copy of the old enchantment indexes and map the renamed trial-spawner sounds.
- Keep the shared Base Metals upgrade hook for old Advantage and released base* worlds.
- Correct the local Base Metals path used by Eclipse and check dependency pins before compilation.

basePower 2.4.13.120061 (Minecraft 1.20.6)

- Bring basePower to Forge 50 and Java 21 without changing the names of existing machines or items.
Expand Down
51 changes: 29 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,56 @@
# basePower

**Minecraft 1.20.6 (Forge), version 2.4.13.120061.**
**Minecraft 1.21.1 (Forge), version 2.4.14.121011.**

See the [1.20.6 port record](docs/1.20.6/PORT-STATUS.md) for the current checks.
Results from earlier versions do not qualify this build.
This version keeps the existing machines and saved-world data while updating
to Forge 52 and Java 21. See the [1.21.1 test results](docs/1.21.1/TEST-RESULTS.md)
for the checked upgrade routes, machine tests and remaining modpack limits.

For the combined Eclipse test, use `runClientAllAdvantage.launch` in this
project. It loads the matching baseSteam and baseElectric candidates. The
[port record](docs/1.21.1/PORT-STATUS.md) separates the automated checks from
the remaining manual gameplay and visual checks.

basePower continues DrCyano's Power Advantage. It provides shared power,
fluids and item transport for baseSteam and baseElectric.

## Playing On 1.20.6
## Playing On 1.21.1

- Install [MMD OreSpawn 4.1.0.120061](https://www.curseforge.com/minecraft/mc-mods/mmd-orespawn/files/9183384) on both client and server.
- Install [MMD OreSpawn 4.1.0.121011](https://www.curseforge.com/minecraft/mc-mods/mmd-orespawn/files/9189594) on both client and server.
- Base Metals is optional for a new basePower world. For a world that already
uses Base Metals, keep it installed and use the matching Forge 1.20.6 build
`3.1.2.120061`. Older Base Metals builds do not have the shared upgrade hook.
uses Base Metals, keep it installed and use the matching Forge 1.21.1 build
`3.1.2.121011` or a later compatible Forge 52 release. Older Base Metals
builds do not have the shared upgrade hook.
- baseSteam and baseElectric are separate mods. Use only their matching
1.20.6 builds. Additional Loot Tables is not needed for the built-in loot.
1.21.1 builds. Additional Loot Tables is not needed for the built-in loot.

**Back up the entire world before upgrading. Test only disposable copies.**
The port keeps existing registry names and machine data. The upgrade checks
use disposable copies of original Advantage and released base* saves, including
connected machines, and check them again after a full restart. Check that the
other mods in your world support 1.20.6 before you upgrade.
other mods in your world support 1.21.1 before you upgrade.
The accepted [1.14 results](docs/1.14/BROADER-QUALIFICATION.md) are historical
evidence, not qualification of this port or a whole modpack.

Recipe-book discovery now follows relevant ingredients. See the [all-Advantage material checklist and automated discovery tests](docs/1.13/RECIPE-DISCOVERY.md). To regenerate the checked-in unlock JSON after changing recipes, run `node tools/generate-recipe-unlocks.js`; `check` rejects missing or stale ingredient criteria.

The [manufacturing progression audit](docs/1.13/MANUFACTURING-PROGRESSION.md) traces survival parts from raw resources, including configured material aliases, processing, loot-only parts and automated restart checks.

## Building Minecraft 1.20.6
## Building Minecraft 1.21.1

The build uses Forge 50.2.0, official `1.20.6` mappings,
MCP `20240429.135109`, ForgeGradle 7.0.34 and Gradle 9.6.1.
The build uses Forge 52.1.0, official `1.21.1` mappings,
MCP `20240808.132146`, ForgeGradle 7.0.34 and Gradle 9.6.1.
Use Java 21 for Gradle, compilation and Minecraft. Mavenizer also
needs Java 25; the development launcher helper uses Java 8. Pass the installed homes using
`-Porg.gradle.java.installations.paths=<java8>,<java21>,<java25>` and disable
automatic discovery and downloads for a reproducibility check.

Use the pinned Base Metals `3.1.2.120061` and OreSpawn `4.1.0.120061` jars.
Use the pinned Base Metals `3.1.2.121011` and OreSpawn `4.1.0.121011` jars.
The source pins and checksums are in `gradle.properties`.
Forge 50 also needs the Mavenizer compatibility jar in the pinned OreSpawn
Forge 52 also needs the Mavenizer compatibility jar in the pinned OreSpawn
checkout's `ci-fixtures/tools/` directory. It fixes decompiled Forge sources
on a clean build and uses Java 25. It is not part of the mod or game runtime.
Set `-Pforge50MavenizerJar=<path>` when that checkout is in another location.
Set `-Pforge52MavenizerJar=<path>` when that checkout is in another location.
If Base Metals is installed, use the pinned 3.1.2 build when testing an upgrade. It lets
both mods preserve old items and machines before Minecraft converts the
chunk. An older Base Metals jar is not a substitute for this upgrade path.
Expand All @@ -57,8 +64,8 @@ gradlew.bat clean check build javadoc genEclipseRuns eclipse isolateEclipseProdu
The default dependency jars are:

```text
D:\BaseMetals\.verification-basemetals1206\Advantage shared hook\build\libs\BaseMetals-3.1.2.120061.jar
D:\MinecraftMineralogy\OS1206\OreSpawn\build\libs\OreSpawn-4.1.0.120061.jar
D:\BaseMetals\.verification-basemetals1211\Advantage shared hook\build\libs\BaseMetals-3.1.2.121011.jar
D:\MinecraftMineralogy\OS1211\OreSpawn\build\libs\OreSpawn-4.1.0.121011.jar
```

Other layouts can pass `-PbaseMetalsDeobfJar=<path>` and `-PoreSpawnDeobfJar=<path>`.
Expand All @@ -67,10 +74,10 @@ Dependencies are never embedded in PowerAdvantage artifacts.
Dependency checksums and source commits are recorded in `gradle.properties`.
Unknown artifacts fail the dependency audit. The release audit also rejects a
player jar that differs from the frozen test kit. Hosted CI requires the Base
Metals pin to be on its upstream `master-1.20.1` branch; a locally tested pin
Metals pin to be on its upstream `master-1.21.1` branch; a locally tested pin
does not qualify a hosted build.

Release jars are written to `build/libs`. Forge 50 uses the same mod jar for play
Release jars are written to `build/libs`. Forge 52 uses the same mod jar for play
and development; `deobfJar` is kept as a task alias for older build scripts.

For Eclipse, import this repository as an existing Gradle project and run:
Expand All @@ -83,10 +90,10 @@ Refresh the project in Eclipse, allow its Java build to finish, and launch the g

Eclipse copies production resources from `build/resources/main`, not directly from `src/main/resources`. This prevents its builder from overwriting the expanded `mods.toml` with raw `${version}` placeholders. After updating this setup, use **Gradle > Refresh Gradle Project**, then **Project > Clean** before relaunching. After editing resources or version properties, run `processResources` or refresh the Gradle project before the Eclipse build. See the [metadata regression notes](docs/1.13/ECLIPSE-METADATA.md).

To prepare a combined client, build the baseSteam and baseElectric `2.2.14.120061` jars,
To prepare a combined client, build the baseSteam and baseElectric `2.2.15.121011` jars,
run `gradlew.bat prepareCombinedEclipseLaunch`, refresh Eclipse, then launch
`runClientAllAdvantage.launch`. Inputs must match
`test-rig/profiles/native1206/dev-core.json`; alternative layouts can pass
`test-rig/profiles/native1211/dev-core.json`; alternative layouts can pass
`-PsteamAdvantageDeobfJar=<path>` and `-PelectricAdvantageDeobfJar=<path>`.
The ordinary `runClient.launch` remains Power-only. Both use the `run` directory;
preparing a launch does not copy, open or qualify a save.
Expand Down Expand Up @@ -122,6 +129,6 @@ its presence is not proof that an upgrade is safe.

The [legacy migration guide](docs/1.13/MIGRATION.md) describes the earlier protocols.
The [Advantage Works 1.20.1 guide](test-rig/NATIVE1201.md) describes the prior
qualification and the checks carried into 1.20.6.
qualification and the checks carried into 1.21.1.

The historical 1.10 handbook remains on the [1.10.2 branch](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.10.2/docs/1.10/README.md).
Loading
Loading