Skip to content

Commit 8d9937b

Browse files
authored
Bring basePower to Minecraft 1.21.1 and keep old worlds working
Bring basePower to Minecraft 1.21.1 and keep old worlds working
2 parents d1cdc73 + c4f119b commit 8d9937b

276 files changed

Lines changed: 3835 additions & 493 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/test-base-metals-pin.sh‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
verify="$(cd "$(dirname "$0")" && pwd)/verify-base-metals-pin.sh"
5+
temporary_root="$(cd "${TMPDIR:-/tmp}" && pwd -P)"
6+
scratch="$(mktemp -d "$temporary_root/basepower-pin.XXXXXXXX")"
7+
cleanup() {
8+
local resolved
9+
resolved="$(cd "$scratch" && pwd -P)"
10+
case "$resolved" in
11+
"$temporary_root"/basepower-pin.*) rm -rf -- "$resolved" ;;
12+
*) echo 'Refusing to clear an unexpected test directory' >&2; return 1 ;;
13+
esac
14+
}
15+
trap cleanup EXIT
16+
mkdir -p "$scratch/bin" "$scratch/project"
17+
cat > "$scratch/bin/gh" <<'MOCK'
18+
#!/usr/bin/env bash
19+
set -euo pipefail
20+
[[ "$#" == 4 && "$1" == api && "$2" == "$EXPECTED_COMPARE" && "$3" == --jq && "$4" == .status ]]
21+
printf '%s\n' "$PIN_STATUS"
22+
MOCK
23+
chmod +x "$scratch/bin/gh"
24+
export PATH="$scratch/bin:$PATH"
25+
commit=1111111111111111111111111111111111111111
26+
cd "$scratch/project"
27+
for minecraft in 1.20.6 1.21.1 1.21.11; do
28+
printf 'minecraft_version=%s\nbasemetals_source_commit=%s\n' "$minecraft" "$commit" > gradle.properties
29+
export EXPECTED_COMPARE="repos/MinecraftModDevelopmentMods/BaseMetals/compare/$commit...master-$minecraft"
30+
export GITHUB_OUTPUT="$scratch/output"
31+
for PIN_STATUS in identical ahead; do
32+
export PIN_STATUS
33+
: > "$GITHUB_OUTPUT"
34+
bash "$verify"
35+
grep -qx "commit=$commit" "$GITHUB_OUTPUT"
36+
done
37+
for PIN_STATUS in behind diverged; do
38+
export PIN_STATUS
39+
: > "$GITHUB_OUTPUT"
40+
if bash "$verify" > "$scratch/rejected.log" 2>&1; then
41+
echo "Incorrectly accepted $minecraft / $PIN_STATUS" >&2
42+
exit 1
43+
fi
44+
test ! -s "$GITHUB_OUTPUT"
45+
done
46+
done
47+
printf 'minecraft_version=invalid\nbasemetals_source_commit=%s\n' "$commit" > gradle.properties
48+
if bash "$verify" > "$scratch/invalid.log" 2>&1; then
49+
echo 'Incorrectly accepted an invalid target' >&2
50+
exit 1
51+
fi
52+
echo 'PASS: target-derived Base Metals ancestry guards and rejection controls'

‎.github/verify-base-metals-pin.sh‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ if [[ ! "$commit" =~ ^[0-9a-f]{40}$ ]]; then
77
exit 1
88
fi
99

10-
branch=master-1.20.6
10+
minecraft="$(sed -n 's/^minecraft_version=//p' gradle.properties)"
11+
if [[ ! "$minecraft" =~ ^1\.[0-9]+\.[0-9]+$ ]]; then
12+
echo "::error::Expected a complete Minecraft target version in gradle.properties"
13+
exit 1
14+
fi
15+
branch="master-$minecraft"
1116
if ! status="$(gh api "repos/MinecraftModDevelopmentMods/BaseMetals/compare/$commit...$branch" --jq '.status')"; then
1217
echo "::error::Could not verify Base Metals $commit on upstream $branch"
1318
exit 1

‎.github/workflows/ci.yml‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: basePower 1.20.6 CI
1+
name: basePower 1.21.1 CI
22

33
on:
44
push:
5-
branches: [master-1.20.6, 'feature/**']
5+
branches: [master-1.21.1, 'feature/**']
66
pull_request:
7-
branches: [master-1.20.6]
7+
branches: [master-1.21.1]
88

99
permissions:
1010
contents: read
1111

1212
concurrency:
13-
group: basepower-1.20.6-${{ github.workflow }}-${{ github.ref }}
13+
group: basepower-1.21.1-${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

1616
jobs:
@@ -21,7 +21,9 @@ jobs:
2121
steps:
2222
- name: Check out PowerAdvantage
2323
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
24-
- name: Require the Base Metals pin on upstream master-1.20.6
24+
- name: Test target-derived dependency guards
25+
run: bash .github/test-base-metals-pin.sh
26+
- name: Require the Base Metals pin on upstream master-1.21.1
2527
id: base-metals-pin
2628
env:
2729
GH_TOKEN: ${{ github.token }}
@@ -32,13 +34,13 @@ jobs:
3234
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
3335
with:
3436
repository: MinecraftModDevelopmentMods/OreSpawn
35-
ref: 4085315345ff043448b316d75e03f4b8da45402d
37+
ref: 62c08169c71f4d4fd8f107289e63fd2a4c7c655c
3638
path: .ci-dependencies/OreSpawn
3739
- name: Check out pinned Base Metals
3840
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
3941
with:
4042
repository: MinecraftModDevelopmentMods/BaseMetals
41-
ref: 9e706db5c85fa2bc7f36dee94f39a5f2fa8ab367
43+
ref: 327c197bcdd0bb5e883d844bb6a6c8791bc580b7
4244
path: .ci-dependencies/BaseMetals
4345
- name: Install pinned Java 25 Mavenizer runtime
4446
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
@@ -74,11 +76,10 @@ jobs:
7476
mavenizer="$orespawn/ci-fixtures/tools/minecraft-mavenizer-0.5.21-orespawn-compat.jar"
7577
mirror="$RUNNER_TEMP/orespawn-mirror"
7678
(cd "$basemetals" && bash gradle/stage-orespawn-release.sh "$mirror")
77-
chmod +x "$orespawn/gradlew" "$basemetals/gradlew"
78-
(cd "$orespawn" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar --no-daemon --stacktrace)
79-
(cd "$basemetals" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar -PorespawnVerificationRepository="$mirror" --no-daemon --stacktrace)
80-
osjar="$orespawn/build/libs/OreSpawn-4.1.0.120061.jar"
81-
bmjar="$basemetals/build/libs/BaseMetals-3.1.2.120061.jar"
79+
(cd "$orespawn" && bash gradlew $MMD_GRADLE_TOOLCHAINS jar --no-daemon --stacktrace)
80+
(cd "$basemetals" && bash gradlew $MMD_GRADLE_TOOLCHAINS jar -PorespawnVerificationRepository="$mirror" --no-daemon --stacktrace)
81+
osjar="$orespawn/build/libs/OreSpawn-4.1.0.121011.jar"
82+
bmjar="$basemetals/build/libs/BaseMetals-3.1.2.121011.jar"
8283
test -f "$osjar" && test -f "$bmjar"
8384
echo "orespawn=$osjar" >> "$GITHUB_OUTPUT"
8485
echo "basemetals=$bmjar" >> "$GITHUB_OUTPUT"
@@ -89,25 +90,25 @@ jobs:
8990
writeReleaseChecksums verifyEclipseProductionClasspath
9091
-PbaseMetalsDeobfJar=${{ steps.dependencies.outputs.basemetals }}
9192
-PoreSpawnDeobfJar=${{ steps.dependencies.outputs.orespawn }}
92-
-Pforge50MavenizerJar=${{ steps.dependencies.outputs.mavenizer }}
93+
-Pforge52MavenizerJar=${{ steps.dependencies.outputs.mavenizer }}
9394
--no-daemon --stacktrace
9495
- name: Upload audited release candidate
9596
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
9697
with:
97-
name: basePower-1.20.6-${{ github.sha }}
98+
name: basePower-1.21.1-${{ github.sha }}
9899
if-no-files-found: error
99100
retention-days: 30
100101
path: |
101-
build/libs/basePower-2.4.13.120061.jar
102-
build/libs/basePower-2.4.13.120061-sources.jar
103-
build/libs/basePower-2.4.13.120061-javadoc.jar
102+
build/libs/basePower-2.4.14.121011.jar
103+
build/libs/basePower-2.4.14.121011-sources.jar
104+
build/libs/basePower-2.4.14.121011-javadoc.jar
104105
build/release/SHA256SUMS
105106
CHANGELOG.txt
106107
- name: Upload diagnostics on failure
107108
if: failure()
108109
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
109110
with:
110-
name: basePower-1.20.6-diagnostics-${{ github.sha }}
111+
name: basePower-1.21.1-diagnostics-${{ github.sha }}
111112
if-no-files-found: ignore
112113
retention-days: 14
113114
path: |

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CodeQL
22

33
on:
44
push:
5-
branches: [master-1.20.6, 'feature/**']
5+
branches: [master-1.21.1, 'feature/**']
66
pull_request:
7-
branches: [master-1.20.6]
7+
branches: [master-1.21.1]
88
schedule:
99
- cron: '47 7 * * 4'
1010

@@ -21,7 +21,9 @@ jobs:
2121
steps:
2222
- name: Check out PowerAdvantage
2323
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
24-
- name: Require the Base Metals pin on upstream master-1.20.6
24+
- name: Test target-derived dependency guards
25+
run: bash .github/test-base-metals-pin.sh
26+
- name: Require the Base Metals pin on upstream master-1.21.1
2527
id: base-metals-pin
2628
env:
2729
GH_TOKEN: ${{ github.token }}
@@ -32,13 +34,13 @@ jobs:
3234
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
3335
with:
3436
repository: MinecraftModDevelopmentMods/OreSpawn
35-
ref: 4085315345ff043448b316d75e03f4b8da45402d
37+
ref: 62c08169c71f4d4fd8f107289e63fd2a4c7c655c
3638
path: .ci-dependencies/OreSpawn
3739
- name: Check out pinned Base Metals
3840
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
3941
with:
4042
repository: MinecraftModDevelopmentMods/BaseMetals
41-
ref: 9e706db5c85fa2bc7f36dee94f39a5f2fa8ab367
43+
ref: 327c197bcdd0bb5e883d844bb6a6c8791bc580b7
4244
path: .ci-dependencies/BaseMetals
4345
- name: Install pinned Java 25 Mavenizer runtime
4446
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
@@ -77,8 +79,8 @@ jobs:
7779
chmod +x "$orespawn/gradlew" "$basemetals/gradlew"
7880
(cd "$orespawn" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar --no-daemon --stacktrace)
7981
(cd "$basemetals" && ./gradlew $MMD_GRADLE_TOOLCHAINS jar -PorespawnVerificationRepository="$mirror" --no-daemon --stacktrace)
80-
echo "orespawn=$orespawn/build/libs/OreSpawn-4.1.0.120061.jar" >> "$GITHUB_OUTPUT"
81-
echo "basemetals=$basemetals/build/libs/BaseMetals-3.1.2.120061.jar" >> "$GITHUB_OUTPUT"
82+
echo "orespawn=$orespawn/build/libs/OreSpawn-4.1.0.121011.jar" >> "$GITHUB_OUTPUT"
83+
echo "basemetals=$basemetals/build/libs/BaseMetals-3.1.2.121011.jar" >> "$GITHUB_OUTPUT"
8284
echo "mavenizer=$mavenizer" >> "$GITHUB_OUTPUT"
8385
- name: Initialize CodeQL
8486
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
@@ -91,6 +93,6 @@ jobs:
9193
./gradlew $MMD_GRADLE_TOOLCHAINS clean classes verifyReleaseDependencies --rerun-tasks --no-build-cache --no-daemon --stacktrace \
9294
-PbaseMetalsDeobfJar=${{ steps.dependencies.outputs.basemetals }} \
9395
-PoreSpawnDeobfJar=${{ steps.dependencies.outputs.orespawn }} \
94-
-Pforge50MavenizerJar=${{ steps.dependencies.outputs.mavenizer }}
96+
-Pforge52MavenizerJar=${{ steps.dependencies.outputs.mavenizer }}
9597
- name: Analyze
9698
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4

‎.github/workflows/validate-gradle-build.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: Validate Gradle Wrapper
33
on:
44
push:
55
branches:
6-
- master-1.20.6
6+
- master-1.21.1
77
- 'feature/**'
88
pull_request:
99
branches:
10-
- master-1.20.6
10+
- master-1.21.1
1111

1212
permissions:
1313
contents: read

‎CHANGELOG.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
basePower 2.4.14.121011 (Minecraft 1.21.1)
2+
3+
- Bring basePower to Forge 52 and Java 21, keeping existing blocks, items and machine data.
4+
- Use the new recipe, advancement, loot and tag folders without changing their in-game names.
5+
- Update fluid gauges to the current renderer while keeping the full texture visible.
6+
- Preserve custom attributes on old modded entities when Minecraft upgrades their save format.
7+
- 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.
8+
- Keep the shared Base Metals upgrade hook for old Advantage and released base* worlds.
9+
- Correct the local Base Metals path used by Eclipse and check dependency pins before compilation.
10+
111
basePower 2.4.13.120061 (Minecraft 1.20.6)
212

313
- Bring basePower to Forge 50 and Java 21 without changing the names of existing machines or items.

‎README.md‎

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,56 @@
11
# basePower
22

3-
**Minecraft 1.20.6 (Forge), version 2.4.13.120061.**
3+
**Minecraft 1.21.1 (Forge), version 2.4.14.121011.**
44

5-
See the [1.20.6 port record](docs/1.20.6/PORT-STATUS.md) for the current checks.
6-
Results from earlier versions do not qualify this build.
5+
This version keeps the existing machines and saved-world data while updating
6+
to Forge 52 and Java 21. See the [1.21.1 test results](docs/1.21.1/TEST-RESULTS.md)
7+
for the checked upgrade routes, machine tests and remaining modpack limits.
8+
9+
For the combined Eclipse test, use `runClientAllAdvantage.launch` in this
10+
project. It loads the matching baseSteam and baseElectric candidates. The
11+
[port record](docs/1.21.1/PORT-STATUS.md) separates the automated checks from
12+
the remaining manual gameplay and visual checks.
713

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

11-
## Playing On 1.20.6
17+
## Playing On 1.21.1
1218

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

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

2835
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.
2936

3037
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.
3138

32-
## Building Minecraft 1.20.6
39+
## Building Minecraft 1.21.1
3340

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

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

5966
```text
60-
D:\BaseMetals\.verification-basemetals1206\Advantage shared hook\build\libs\BaseMetals-3.1.2.120061.jar
61-
D:\MinecraftMineralogy\OS1206\OreSpawn\build\libs\OreSpawn-4.1.0.120061.jar
67+
D:\BaseMetals\.verification-basemetals1211\Advantage shared hook\build\libs\BaseMetals-3.1.2.121011.jar
68+
D:\MinecraftMineralogy\OS1211\OreSpawn\build\libs\OreSpawn-4.1.0.121011.jar
6269
```
6370

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

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

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

8491
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).
8592

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

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

127134
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).

0 commit comments

Comments
 (0)