Skip to content

Commit 1fc2fb3

Browse files
authored
Merge pull request #3 from SkyBlade1978/feature/basepower-1.12.2-identity-migration
Bring basePower to Minecraft 1.12.2
2 parents 4054eba + 3aed1ac commit 1fc2fb3

511 files changed

Lines changed: 5738 additions & 2569 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/workflows/ci.yml‎

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
contents: read
1414

1515
concurrency:
16-
group: poweradvantage-1.12-${{ github.workflow }}-${{ github.ref }}
16+
group: basepower-1.12-${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

1919
jobs:
@@ -26,6 +26,14 @@ jobs:
2626
- name: Check out source
2727
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2828

29+
- name: Check out pinned OreSpawn
30+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
31+
with:
32+
repository: MinecraftModDevelopmentMods/OreSpawn
33+
ref: 72205b9bb6bfff17cf69715c0d5bd4d2efd3b148
34+
path: .ci-dependencies/OreSpawn
35+
persist-credentials: false
36+
2937
- name: Install Java 8 toolchain
3038
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
3139
with:
@@ -41,6 +49,21 @@ jobs:
4149
- name: Set up Gradle
4250
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
4351

52+
- name: Build pinned OreSpawn development jar
53+
id: orespawn
54+
shell: bash
55+
run: |
56+
set -euo pipefail
57+
dependency="$GITHUB_WORKSPACE/.ci-dependencies/OreSpawn"
58+
chmod +x "$dependency/gradlew"
59+
(
60+
cd "$dependency"
61+
./gradlew deobfJar --no-daemon --stacktrace
62+
)
63+
jar="$dependency/build/libs-dev/OreSpawn-4.1.3.112021-deobf.jar"
64+
test -f "$jar"
65+
echo "jar=$jar" >> "$GITHUB_OUTPUT"
66+
4467
- name: Make the wrapper executable
4568
run: chmod +x ./gradlew
4669

@@ -56,26 +79,27 @@ jobs:
5679
./gradlew clean check build javadoc verifyReleaseDependencies verifyReleaseArtifacts
5780
writeReleaseChecksums verifyEclipseProductionClasspath
5881
-PrebornCoreVerificationRepository=${{ steps.reborncore.outputs.repository }}
82+
-PoreSpawnDeobfJar=${{ steps.orespawn.outputs.jar }}
5983
--no-daemon --stacktrace
6084
6185
- name: Upload audited release candidate
6286
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
6387
with:
64-
name: PowerAdvantage-1.12.2-${{ github.sha }}
88+
name: basePower-1.12.2-${{ github.sha }}
6589
if-no-files-found: error
6690
retention-days: 30
6791
path: |
68-
build/libs/PowerAdvantage-2.4.1.112021.jar
69-
build/libs/PowerAdvantage-2.4.1.112021-sources.jar
70-
build/libs/PowerAdvantage-2.4.1.112021-javadoc.jar
92+
build/libs/basePower-2.4.4.112021.jar
93+
build/libs/basePower-2.4.4.112021-sources.jar
94+
build/libs/basePower-2.4.4.112021-javadoc.jar
7195
build/release/SHA256SUMS
7296
CHANGELOG.txt
7397
7498
- name: Upload diagnostics on failure
7599
if: failure()
76100
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
77101
with:
78-
name: PowerAdvantage-1.12.2-diagnostics-${{ github.sha }}
102+
name: basePower-1.12.2-diagnostics-${{ github.sha }}
79103
if-no-files-found: ignore
80104
retention-days: 14
81105
path: |

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ jobs:
2626
- name: Check out source
2727
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2828

29+
- name: Check out pinned OreSpawn
30+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
31+
with:
32+
repository: MinecraftModDevelopmentMods/OreSpawn
33+
ref: 72205b9bb6bfff17cf69715c0d5bd4d2efd3b148
34+
path: .ci-dependencies/OreSpawn
35+
persist-credentials: false
36+
2937
- name: Install Java 8 toolchain
3038
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
3139
with:
@@ -41,6 +49,21 @@ jobs:
4149
- name: Set up Gradle
4250
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
4351

52+
- name: Build pinned OreSpawn development jar
53+
id: orespawn
54+
shell: bash
55+
run: |
56+
set -euo pipefail
57+
dependency="$GITHUB_WORKSPACE/.ci-dependencies/OreSpawn"
58+
chmod +x "$dependency/gradlew"
59+
(
60+
cd "$dependency"
61+
./gradlew deobfJar --no-daemon --stacktrace
62+
)
63+
jar="$dependency/build/libs-dev/OreSpawn-4.1.3.112021-deobf.jar"
64+
test -f "$jar"
65+
echo "jar=$jar" >> "$GITHUB_OUTPUT"
66+
4467
- name: Stage exact RebornCore compile API
4568
id: reborncore
4669
run: |
@@ -57,6 +80,7 @@ jobs:
5780
run: |
5881
chmod +x ./gradlew
5982
./gradlew clean classes --rerun-tasks --no-build-cache --no-daemon --stacktrace \
83+
-PoreSpawnDeobfJar="${{ steps.orespawn.outputs.jar }}" \
6084
-PrebornCoreVerificationRepository=${{ steps.reborncore.outputs.repository }}
6185
6286
- name: Analyze

‎.github/workflows/release-on-tag.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ permissions:
1010
contents: read
1111

1212
concurrency:
13-
group: poweradvantage-release-tag-${{ github.ref_name }}
13+
group: basepower-release-tag-${{ github.ref_name }}
1414
cancel-in-progress: false
1515

1616
jobs:
1717
validate-release-tag:
1818
name: Validate tag for manual release confirmation
19-
if: github.repository == 'MinecraftModDevelopmentMods/PowerAdvantage'
19+
if: github.repository == 'MinecraftModDevelopmentMods/basePower'
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 10
2222

‎CHANGELOG.txt‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
Unreleased test-coverage repairs for 1.12.2
1+
2.4.4.112021 - basePower for Minecraft 1.12.2
2+
3+
- Bring basePower to Forge 1.12.2. Upgrade worlds from the original Advantage mods or the 1.10.2 base mods, keeping blocks, items, fluids and machine contents.
4+
- Preserve the world-generation settings for oil, sulfur and lithium when moving to OreSpawn 4 on 1.12.2.
5+
- Keep the saved MMDLib crusher recipe IDs when replacing the old 1.12.2 Advantage mods.
6+
- Fix the still so pipes fill the input tank and can only drain the output. Crude oil from Mineralogy also works in the still.
7+
8+
Earlier 1.12.2 test-coverage repairs
29

310
- Restore the missing carbon-dust recipe name from registered coal and charcoal powders, without replacing existing entries or changing recipe amounts.
411
- Enable Forge's universal bucket during mod construction so oil buckets work without another mod enabling them first.

‎README.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
# PowerAdvantage
1+
# basePower for Minecraft 1.12.2
22

3-
Power Advantage provides shared power, fluid, and item transport systems for its Minecraft 1.12.2 expansion mods.
3+
basePower continues DrCyano's Power Advantage. It adds conveyors, filters, fluid plumbing and the shared systems used by baseSteam and baseElectric. The 1.12.2 build uses Forge 14.23.5.2859 and Java 8.
44

5-
The [test coverage backport notes](TEST-COVERAGE-BACKPORT.md#final-recorded-candidate) record the final machine, restart, control, partial-network, GUI, endurance, connected-world and reproducibility results alongside exact candidate hashes. The bounded legacy checks pass; the recipe progression graph is still partial. Earlier failures, modern follow-up findings and manual-testing limits are kept in the notes. This is not an all-machines or all-worlds guarantee.
5+
## Moving an existing world
6+
7+
You can upgrade from the original Advantage mods or the base mods on 1.10.2. If you're already using the old Advantage mods on 1.12.2, you can replace them too. Back up your world and config, replace the old mods together, then try the upgrade on a copy. Save, close Minecraft completely and reopen the copy before moving your main world.
8+
9+
Use Forge 14.23.5.2859 or newer, with the 1.12.2 builds of Base Metals, MMDLib and MMD OreSpawn 4.1.3 or newer in the 4.x line. Existing MMDLib crusher recipes keep their saved IDs. If Forge still warns about missing entries, cancel and check what's missing before proceeding. See the [world upgrade guide](docs/1.12-upgrade.md).
10+
11+
[CurseForge](https://www.curseforge.com/minecraft/mc-mods/basepower) | [Player wiki](https://github.com/MinecraftModDevelopmentMods/basePower/wiki)
612

713
## Building Minecraft 1.12.2
814

@@ -20,4 +26,6 @@ For Eclipse, import the repository as an existing Gradle project and run:
2026
gradlew.bat cleanEclipse verifyEclipseProductionClasspath
2127
```
2228

23-
Base Metals and OreSpawn remain required distribution dependencies but are deliberately absent from the compile classpath. Optional RF and RebornCore integrations compile against SHA-256-pinned API inputs and are not bundled or added to normal development launches. CI stages the exact historical RebornCore Maven release because the later CurseForge archive with the same version has different contents.
29+
Build the pinned OreSpawn 4.1.3.112021 development jar first, or pass `-PoreSpawnDeobfJar=<path>`. CI builds the exact source in `gradle.properties`. Base Metals is a distribution dependency, not a compile dependency. Optional RF and RebornCore APIs are compile-only and are not bundled. CI stages the exact historical RebornCore Maven artifact; the later CurseForge archive with the same version has different contents.
30+
31+
See [Checking a base workshop upgrade](docs/1.12-validation.md) for the current test procedure. The [test coverage notes](TEST-COVERAGE-BACKPORT.md) describe the preceding Advantage build.

‎build.gradle‎

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ tasks.register('clientResourceProbeJar', Jar) {
3131

3232
group = project.mod_group
3333
version = project.mod_version
34-
base.archivesName = 'PowerAdvantage'
34+
base.archivesName = 'basePower'
3535

3636
def versionParts = project.mod_version.toString().tokenize('.')
3737
if (versionParts.size() != 4 || !versionParts.every { it ==~ /\d+/ }) {
@@ -181,6 +181,12 @@ repositories {
181181
}
182182

183183
def rfApiJar = file('libs/RF-API.jar')
184+
// Use the matching OreSpawn 1.12 build; CI may stage it outside the sibling checkout.
185+
def oreSpawnJar = file(providers.gradleProperty('oreSpawnDeobfJar').getOrElse(
186+
"../../../MinecraftMineralogy/OS112/OreSpawn/build/libs-dev/OreSpawn-${project.orespawn_version}-deobf.jar"))
187+
if (!oreSpawnJar.isFile()) {
188+
throw new GradleException("Missing OreSpawn development jar: ${oreSpawnJar}. Build the pinned source or set -PoreSpawnDeobfJar=<path>.")
189+
}
184190
def usingStagedRebornCore = providers.gradleProperty('rebornCoreVerificationRepository').isPresent()
185191
def rebornCoreCoordinate = usingStagedRebornCore
186192
? "curse.maven:reborncore-${project.reborncore_curse_project_id}:${project.reborncore_curse_file_id}"
@@ -197,6 +203,7 @@ dependencies {
197203
// but do not package or launch PowerAdvantage with the provider mods.
198204
compileOnly files(rfApiJar)
199205
compileOnly rebornCoreCoordinate
206+
implementation files(oreSpawnJar)
200207
}
201208

202209
tasks.named('processResources', ProcessResources) {
@@ -326,7 +333,7 @@ tasks.register('verifyReleaseConfiguration') {
326333
group = 'verification'
327334
description = 'Validates release identity, target metadata, and optional integration policy.'
328335
doLast {
329-
if (project.mod_version != '2.4.1.112021') {
336+
if (project.mod_version != '2.4.4.112021') {
330337
throw new GradleException("Unexpected PowerAdvantage release version: ${project.mod_version}")
331338
}
332339
if (project.minecraft_version != '1.12.2'
@@ -341,10 +348,10 @@ tasks.register('verifyReleaseConfiguration') {
341348
|| project.gradle_java_version != '17') {
342349
throw new GradleException('Unexpected release dispatcher target metadata')
343350
}
344-
if (project.mod_id != 'poweradvantage'
345-
|| project.group.toString() != 'com.mcmoddev.poweradvantage'
346-
|| base.archivesName.get() != 'PowerAdvantage'
347-
|| project.curseforge_project_id != '240982') {
351+
if (project.mod_id != 'basepower'
352+
|| project.group.toString() != 'zone.moddev.mc.basepower'
353+
|| base.archivesName.get() != 'basePower'
354+
|| project.curseforge_project_id != '1780140') {
348355
throw new GradleException('Unexpected Forge, Maven, archive, or CurseForge identity')
349356
}
350357
if (project.cf_requirements != 'base-metals,mmd-orespawn'
@@ -361,17 +368,17 @@ tasks.register('verifyReleaseConfiguration') {
361368
throw new GradleException('Unexpected RebornCore compile API identity')
362369
}
363370
String mainSource = file(
364-
'src/main/java/com/mcmoddev/poweradvantage/PowerAdvantage.java').getText('UTF-8')
365-
if (!mainSource.contains('MODID = "poweradvantage"')
366-
|| !mainSource.contains('VERSION = "2.4.1.112021"')
367-
|| !mainSource.contains('dependencies = "after:basemetals"')) {
371+
'src/main/java/zone/moddev/mc/basepower/PowerAdvantage.java').getText('UTF-8')
372+
if (!mainSource.contains('MODID = "basepower"')
373+
|| !mainSource.contains('VERSION = "2.4.4.112021"')
374+
|| !mainSource.contains('required-before:orespawn@[4.1.3,5.0.0)')) {
368375
throw new GradleException('PowerAdvantage source identity or optional BaseMetals policy changed')
369376
}
370377
if (!file('src/main/java/cyano/poweradvantage/api/PoweredEntity.java').isFile()) {
371378
throw new GradleException('Legacy cyano.poweradvantage.api compatibility surface is missing')
372379
}
373380
String entitySource = file(
374-
'src/main/java/com/mcmoddev/poweradvantage/init/Entities.java').getText('UTF-8')
381+
'src/main/java/zone/moddev/mc/basepower/init/Entities.java').getText('UTF-8')
375382
[
376383
'tileentity.pipe_terminal', 'tileentity.fluid_drain',
377384
'tileentity.fluid_discharge', 'tileentity.fluid_storage_tank',
@@ -386,8 +393,8 @@ tasks.register('verifyReleaseConfiguration') {
386393
}
387394
def metadata = new JsonSlurper().parse(file('src/main/resources/mcmod.info'))
388395
def mod = metadata instanceof List ? metadata.first() : metadata
389-
if (mod.modid != 'poweradvantage') {
390-
throw new GradleException('Source mcmod.info does not use the stable poweradvantage mod id')
396+
if (mod.modid != 'basepower') {
397+
throw new GradleException('Source mcmod.info does not use the stable basepower mod id')
391398
}
392399
}
393400
}
@@ -397,6 +404,11 @@ tasks.register('verifyReleaseDependencies') {
397404
description = 'Resolves and audits Forge plus the exact optional compile APIs.'
398405
dependsOn tasks.named('verifyReleaseConfiguration')
399406
doLast {
407+
def oreSpawnHash = MessageDigest.getInstance('SHA-256').digest(oreSpawnJar.bytes)
408+
.encodeHex().toString().toUpperCase(Locale.ROOT)
409+
if (oreSpawnHash != project.orespawn_deobf_sha256) {
410+
throw new GradleException("Unexpected OreSpawn development artifact: ${oreSpawnHash}")
411+
}
400412
if (!rfApiJar.isFile()) {
401413
throw new GradleException("Missing tracked RF API jar: ${rfApiJar}")
402414
}
@@ -453,7 +465,10 @@ tasks.register('verifyReleaseDependencies') {
453465
|| runtimeFiles.contains(rebornCoreJar.canonicalFile)) {
454466
throw new GradleException('Optional RF or RebornCore API leaked onto runtimeClasspath')
455467
}
456-
List<String> forbiddenRuntimeMods = runtimeFiles.collect { it.name.toLowerCase(Locale.ROOT) }
468+
if (!compileFiles.contains(oreSpawnJar.canonicalFile) || !runtimeFiles.contains(oreSpawnJar.canonicalFile)) {
469+
throw new GradleException('Pinned OreSpawn is missing from the development classpath')
470+
}
471+
List<String> forbiddenRuntimeMods = (runtimeFiles - oreSpawnJar.canonicalFile).collect { it.name.toLowerCase(Locale.ROOT) }
457472
.findAll { name ->
458473
name.contains('basemetals') || name.contains('orespawn')
459474
|| name.contains('tesla') || name.contains('reborncore')
@@ -503,16 +518,16 @@ tasks.register('verifyReleaseArtifacts') {
503518
new ZipFile(mainJar).withCloseable { zip ->
504519
List<String> names = zip.entries().collect { it.name }
505520
['mcmod.info', 'pack.mcmeta',
506-
'com/mcmoddev/poweradvantage/PowerAdvantage.class',
521+
'zone/moddev/mc/basepower/PowerAdvantage.class',
507522
'cyano/poweradvantage/api/PoweredEntity.class',
508-
'assets/poweradvantage/lang/en_us.lang'].each { required ->
523+
'assets/basepower/lang/en_us.lang'].each { required ->
509524
if (!names.contains(required)) {
510525
throw new GradleException("Release jar is missing ${required}")
511526
}
512527
}
513528
['agent-notes/', '.codex/', 'src/test/', 'fernflower_abstract_parameter_names.txt',
514529
'cofh/api/', 'reborncore/api/', 'cyano/basemetals/', 'com/mcmoddev/lib/',
515-
'net/minecraft/', 'net/minecraftforge/'].each { forbidden ->
530+
'net/minecraft/', 'net/minecraftforge/', 'zone/moddev/mc/orespawn/', 'com/mcmoddev/orespawn/'].each { forbidden ->
516531
if (names.any { it.contains(forbidden) }) {
517532
throw new GradleException("Release jar contains forbidden entry matching ${forbidden}")
518533
}
@@ -546,7 +561,7 @@ tasks.register('verifyReleaseArtifacts') {
546561
}
547562

548563
new ZipFile(new File(libs, expectedReleaseFiles.get()[1])).withCloseable { sourceZip ->
549-
if (sourceZip.getEntry('com/mcmoddev/poweradvantage/PowerAdvantage.java') == null
564+
if (sourceZip.getEntry('zone/moddev/mc/basepower/PowerAdvantage.java') == null
550565
|| sourceZip.getEntry('cyano/poweradvantage/api/PoweredEntity.java') == null) {
551566
throw new GradleException('Sources jar is missing implementation or legacy API sources')
552567
}
@@ -564,6 +579,9 @@ tasks.register('writeReleaseChecksums') {
564579
description = 'Writes SHA-256 checksums for the audited release jars.'
565580
dependsOn tasks.named('verifyReleaseArtifacts')
566581
def outputFile = layout.buildDirectory.file('release/SHA256SUMS')
582+
inputs.files(expectedReleaseFiles.map { names ->
583+
names.collect { layout.buildDirectory.file("libs/${it}").get().asFile }
584+
})
567585
outputs.file(outputFile)
568586
doLast {
569587
File output = outputFile.get().asFile
@@ -645,17 +663,17 @@ publishing {
645663
pom {
646664
name = 'Power Advantage'
647665
description = project.mod_description
648-
url = 'https://github.com/MinecraftModDevelopmentMods/PowerAdvantage'
666+
url = 'https://github.com/MinecraftModDevelopmentMods/basePower'
649667
licenses {
650668
license {
651669
name = 'GNU Lesser General Public License, Version 3'
652670
url = 'https://www.gnu.org/licenses/lgpl-3.0.txt'
653671
}
654672
}
655673
scm {
656-
connection = 'scm:git:https://github.com/MinecraftModDevelopmentMods/PowerAdvantage.git'
657-
developerConnection = 'scm:git:ssh://git@github.com/MinecraftModDevelopmentMods/PowerAdvantage.git'
658-
url = 'https://github.com/MinecraftModDevelopmentMods/PowerAdvantage'
674+
connection = 'scm:git:https://github.com/MinecraftModDevelopmentMods/basePower.git'
675+
developerConnection = 'scm:git:ssh://git@github.com/MinecraftModDevelopmentMods/basePower.git'
676+
url = 'https://github.com/MinecraftModDevelopmentMods/basePower'
659677
}
660678
}
661679
}

0 commit comments

Comments
 (0)