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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
contents: read

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

jobs:
Expand Down Expand Up @@ -89,9 +89,9 @@ jobs:
if-no-files-found: error
retention-days: 30
path: |
build/libs/PowerAdvantage-2.4.7.116051.jar
build/libs/PowerAdvantage-2.4.7.116051-sources.jar
build/libs/PowerAdvantage-2.4.7.116051-javadoc.jar
build/libs/basePower-2.4.8.116051.jar
build/libs/basePower-2.4.8.116051-sources.jar
build/libs/basePower-2.4.8.116051-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.txt
- name: Upload diagnostics on failure
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ permissions:
contents: read

concurrency:
group: poweradvantage-release-tag-${{ github.ref_name }}
group: basepower-release-tag-${{ github.ref_name }}
cancel-in-progress: false

jobs:
validate-release-tag:
name: Validate tag for manual release confirmation
if: github.repository == 'MinecraftModDevelopmentMods/PowerAdvantage'
if: github.repository == 'MinecraftModDevelopmentMods/basePower'
runs-on: ubuntu-latest
timeout-minutes: 10

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
basePower 2.4.8.116051 (Minecraft 1.16.5)

- Bring the basePower name and shared base* creative tab to Minecraft 1.16.5.
- Carry forward existing base* world data and map legacy Advantage blocks, items and fluids when upgrading older saves.
- Keep legacy OreSpawn settings when migrating a config, without overwriting an existing profile.
- Fix Eclipse refreshes when ForgeGradle reuses an existing client or server launch.

Power Advantage 2.4.7.116051 (Minecraft 1.16.5)

- Charge energy sources only for what consumers accept, retaining rejected energy for the next machine.
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# PowerAdvantage
# basePower

**Minecraft 1.16.5, version 2.4.7.116051. Source port candidate.**
**Minecraft 1.16.5, version 2.4.8.116051.**

See the [1.16 port record](docs/1.16/PORT-STATUS.md) for current checks and remaining
work. The accepted [1.15 test record](docs/1.15/CURRENT-QUALIFICATION.md) is retained
as historical evidence, not a pass for this version. Manual 1.16 acceptance is
still required.
Use Forge 36.2.34, Base Metals 3.1.1.116051 and OreSpawn 4.1.0.116051.
baseSteam and baseElectric 2.2.9.116051 use this version of basePower.
The [1.16.5 test record](docs/1.16/BASE-RELEASE-CANDIDATE.md) explains what
we checked before release and how to run the combined client in Eclipse.

The [test-suite review](docs/1.16/TEST-SUITE-AUDIT.md) separates operating checks
from saved-state and presence checks. It records the remaining machine coverage
Expand All @@ -16,12 +16,14 @@ inputs, real server ticks, blocked and starved controls, and full-process
restarts. They check useful output and retained resources, not just animation
or a rising progress counter.

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

**Back up the entire world before upgrading. Test only disposable copies.**
The port retains existing registry names and legacy migration code. Upgrade tests
use disposable original and maintained saves, including connected machines.
Check every other mod's target-version support too.
The released base* versions already use the new registry names. This port
also maps original Advantage names and saved machine data to base* names.
Upgrade tests use disposable copies; check every other mod's target-version
support before opening your own world.
The accepted [1.14 results](docs/1.14/BROADER-QUALIFICATION.md) are historical
evidence, not qualification of this port or a whole modpack.

Expand Down
106 changes: 56 additions & 50 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ plugins {

group = project.mod_group
version = project.mod_version
base.archivesName = 'PowerAdvantage'
base.archivesName = 'basePower'

def versionParts = project.mod_version.toString().tokenize('.')
if (versionParts.size() != 4 || !versionParts.every { it ==~ /\d+/ }) {
Expand Down Expand Up @@ -103,7 +103,7 @@ minecraft {
workingDir.convention layout.projectDirectory.dir(configuredRunDirectory)
systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'info'
mods { poweradvantage { source sourceSets.main } }
mods { basepower { source sourceSets.main } }
environment 'target', forge36RunTargets[name]
environment 'MCP_MAPPINGS', "${mapping_channel}_${mapping_version}"
environment 'MCP_VERSION', mcp_version
Expand Down Expand Up @@ -319,7 +319,7 @@ tasks.register('verifyReleaseConfiguration') {
if (new JsonSlurper().parse(file('src/main/resources/pack.mcmeta')).pack.pack_format != 6) {
throw new GradleException('Minecraft 1.16.5 resources must use pack format 6')
}
if (project.mod_version != '2.4.7.116051') {
if (project.mod_version != '2.4.8.116051') {
throw new GradleException("Unexpected PowerAdvantage release version: ${project.mod_version}")
}
if (project.minecraft_version != '1.16.5'
Expand All @@ -335,10 +335,10 @@ tasks.register('verifyReleaseConfiguration') {
|| project.gradle_java_version != '17') {
throw new GradleException('Unexpected release dispatcher target metadata')
}
if (project.mod_id != 'poweradvantage'
|| project.group.toString() != 'zone.moddev.mc.poweradvantage'
|| base.archivesName.get() != 'PowerAdvantage'
|| project.curseforge_project_id != '240982') {
if (project.mod_id != 'basepower'
|| project.group.toString() != 'zone.moddev.mc.basepower'
|| base.archivesName.get() != 'basePower'
|| project.curseforge_project_id != '1780140') {
throw new GradleException('Unexpected Forge, Maven, archive, or CurseForge identity')
}
if (project.cf_requirements != 'base-metals,mmd-orespawn'
Expand All @@ -353,17 +353,17 @@ tasks.register('verifyReleaseConfiguration') {
throw new GradleException('Unexpected Base Metals or OreSpawn dependency identity')
}
String mainSource = file(
'src/main/java/zone/moddev/mc/poweradvantage/PowerAdvantage.java').getText('UTF-8')
if (!mainSource.contains('MODID = "poweradvantage"')
|| !mainSource.contains('VERSION = "2.4.7.116051"')
'src/main/java/zone/moddev/mc/basepower/PowerAdvantage.java').getText('UTF-8')
if (!mainSource.contains('MODID = "basepower"')
|| !mainSource.contains('VERSION = "2.4.8.116051"')
|| !mainSource.contains('@Mod(PowerAdvantage.MODID)')) {
throw new GradleException('PowerAdvantage source identity changed')
}
if (!file('src/main/java/cyano/poweradvantage/api/PoweredEntity.java').isFile()) {
throw new GradleException('Legacy cyano.poweradvantage.api compatibility surface is missing')
}
String entitySource = file(
'src/main/java/zone/moddev/mc/poweradvantage/init/Entities.java').getText('UTF-8')
'src/main/java/zone/moddev/mc/basepower/init/Entities.java').getText('UTF-8')
[
'tileentity.pipe_terminal', 'tileentity.fluid_drain',
'tileentity.fluid_discharge', 'tileentity.fluid_storage_tank',
Expand All @@ -377,7 +377,7 @@ tasks.register('verifyReleaseConfiguration') {
}
}
String modsToml = file('src/main/resources/META-INF/mods.toml').getText('UTF-8').replace('\r\n', '\n')
['modId="poweradvantage"', 'modId="basemetals"', 'modId="orespawn"',
['modId="basepower"', 'modId="basemetals"', 'modId="orespawn"',
'mandatory=true'].each { required ->
if (!modsToml.contains(required)) {
throw new GradleException("Source mods.toml is missing ${required}")
Expand Down Expand Up @@ -407,9 +407,9 @@ tasks.register('verifyReleaseConfiguration') {
}
}
Map provider = new JsonSlurper().parse(file(
'src/main/resources/data/poweradvantage/orespawn/provider.json')) as Map
'src/main/resources/data/basepower/orespawn/provider.json')) as Map
Map desertOil = provider.fluid_deposits[
'poweradvantage:fluid_deposit/desert_crude_oil'].dimensions['minecraft:overworld'] as Map
'basepower:fluid_deposit/desert_crude_oil'].dimensions['minecraft:overworld'] as Map
if (desertOil.biome_dictionary != ['SANDY']
|| (desertOil.excluded_biome_dictionary as Set) != (['BEACH', 'MESA'] as Set)) {
throw new GradleException(
Expand Down Expand Up @@ -544,12 +544,12 @@ tasks.register('verifyReleaseArtifacts') {
List<String> names = zip.entries().collect { it.name }
['META-INF/mods.toml', 'META-INF/accesstransformer.cfg', 'pack.mcmeta',
'coremods/poweradvantage_116_migration.js',
'zone/moddev/mc/poweradvantage/PowerAdvantage.class',
'zone/moddev/mc/basepower/PowerAdvantage.class',
'cyano/poweradvantage/api/PoweredEntity.class',
'cyano/poweradvantage/api/fluid/FluidNetworkApi.class',
'assets/poweradvantage/lang/en_us.json',
'data/poweradvantage/recipes/fluid_drain.json',
'data/poweradvantage/advancements/recipes/sprocket_rod_normal.json'].each { required ->
'assets/basepower/lang/en_us.json',
'data/basepower/recipes/fluid_drain.json',
'data/basepower/advancements/recipes/sprocket_rod_normal.json'].each { required ->
if (!names.contains(required)) {
throw new GradleException("Release jar is missing ${required}")
}
Expand All @@ -573,7 +573,7 @@ tasks.register('verifyReleaseArtifacts') {
}
String modsToml = zip.getInputStream(zip.getEntry('META-INF/mods.toml'))
.getText(StandardCharsets.UTF_8.name())
if (!modsToml.contains('modId="poweradvantage"')
if (!modsToml.contains('modId="basepower"')
|| !modsToml.contains("version=\"${project.mod_version}\"")
|| !modsToml.contains('modId="basemetals"')
|| !modsToml.contains('modId="orespawn"')) {
Expand Down Expand Up @@ -601,7 +601,7 @@ tasks.register('verifyReleaseArtifacts') {
}

new ZipFile(new File(libs, expectedReleaseFiles.get()[1])).withCloseable { sourceZip ->
if (sourceZip.getEntry('zone/moddev/mc/poweradvantage/PowerAdvantage.java') == null
if (sourceZip.getEntry('zone/moddev/mc/basepower/PowerAdvantage.java') == null
|| sourceZip.getEntry('cyano/poweradvantage/api/PoweredEntity.java') == null) {
throw new GradleException('Sources jar is missing implementation or legacy API sources')
}
Expand Down Expand Up @@ -701,17 +701,17 @@ publishing {
pom {
name = 'Power Advantage'
description = project.mod_description
url = 'https://github.com/MinecraftModDevelopmentMods/PowerAdvantage'
url = 'https://github.com/MinecraftModDevelopmentMods/basePower'
licenses {
license {
name = 'GNU Lesser General Public License, Version 3'
url = 'https://www.gnu.org/licenses/lgpl-3.0.txt'
}
}
scm {
connection = 'scm:git:https://github.com/MinecraftModDevelopmentMods/PowerAdvantage.git'
developerConnection = 'scm:git:ssh://git@github.com/MinecraftModDevelopmentMods/PowerAdvantage.git'
url = 'https://github.com/MinecraftModDevelopmentMods/PowerAdvantage'
connection = 'scm:git:https://github.com/MinecraftModDevelopmentMods/basePower.git'
developerConnection = 'scm:git:ssh://git@github.com/MinecraftModDevelopmentMods/basePower.git'
url = 'https://github.com/MinecraftModDevelopmentMods/basePower'
}
}
}
Expand Down Expand Up @@ -839,10 +839,10 @@ tasks.register('isolateEclipseProductionRuns') {
"key=\"MC_VERSION\" value=\"${project.minecraft_version}\"")
if (launch.name in ['runClient.launch', 'runServer.launch', 'runData.launch']) {
// Eclipse compiles into bin/main, not Gradle's merged run output.
def launchXml = new groovy.xml.XmlSlurper().parseText(contents)
def launchXml = new groovy.xml.XmlParser().parseText(contents)
def modClasses = launchXml.mapAttribute.find {
it.@key.text() == 'org.eclipse.debug.core.environmentVariables'
}.mapEntry.findAll { it.@key.text() == 'MOD_CLASSES' }
it.@key == 'org.eclipse.debug.core.environmentVariables'
}.mapEntry.findAll { it.@key == 'MOD_CLASSES' }
if (modClasses.size() != 1) {
throw new GradleException("${launch.name} must define one MOD_CLASSES entry")
}
Expand Down Expand Up @@ -879,26 +879,32 @@ tasks.register('isolateEclipseProductionRuns') {
}.findAll { File runtimeFile ->
!mainOutputs.contains(runtimeFile)
}
List<String> launchLines = contents.readLines()
int buildshipContainerLine = launchLines.findIndexOf {
it.contains('org.eclipse.buildship.core.gradleclasspathcontainer')
def parser = new groovy.xml.XmlParser()
def launchXml = parser.parseText(contents)
def classpath = launchXml.listAttribute.find { it.@key == 'org.eclipse.jdt.launching.CLASSPATH' }
if (classpath == null) {
throw new GradleException("${name} is missing its explicit classpath")
}
if (buildshipContainerLine < 0) {
throw new GradleException("${name} is missing the Buildship classpath container")
// A refresh can reuse an already isolated launch. Replace its old runtime
// archives too, but keep ForgeGradle's separate Slime Launcher entry.
def previousRuntime = classpath.listEntry.findAll { entry ->
def runtime = parser.parseText(entry.@value)
String archive = runtime.@externalArchive
runtime.@containerPath == 'org.eclipse.buildship.core.gradleclasspathcontainer'
|| (archive && !file(archive).name.startsWith('slime-launcher-'))
}
List<String> runtimeEntries = productionRuntime.collect { File runtimeFile ->
String escapedPath = runtimeFile.canonicalPath
.replace('&', '&amp;amp;')
.replace('<', '&amp;lt;')
.replace('>', '&amp;gt;')
(' <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; '
+ 'standalone=&quot;no&quot;?&gt;&lt;runtimeClasspathEntry externalArchive=&quot;'
+ escapedPath
+ '&quot; type=&quot;2&quot; path=&quot;5&quot; /&gt;"/>')
if (previousRuntime.isEmpty()) {
throw new GradleException("${name} is missing its production runtime entries")
}
launchLines.remove(buildshipContainerLine)
launchLines.addAll(buildshipContainerLine, runtimeEntries)
contents = launchLines.join('\n') + '\n'
int runtimeIndex = classpath.children().indexOf(previousRuntime.first())
previousRuntime.each { classpath.remove(it) }
def runtimeEntries = productionRuntime.collect { File runtimeFile ->
def archive = new Node(null, 'runtimeClasspathEntry',
[externalArchive: runtimeFile.path, type: '2', path: '5'])
new Node(null, 'listEntry', [value: groovy.xml.XmlUtil.serialize(archive)])
}
classpath.children().addAll(runtimeIndex, runtimeEntries)
contents = groovy.xml.XmlUtil.serialize(launchXml)

['--cache', '--metadata', '--to-srg', '--to-obf'].each { option ->
String prefix = option + ' '
Expand Down Expand Up @@ -1135,9 +1141,9 @@ tasks.register('verifyRecipeTagGuards') {
throw new GradleException("${recipeFile.path} contains a non-object recipe condition")
}
Set<String> guards = conditions
.findAll { it instanceof Map && it.type == 'poweradvantage:tag_not_empty' }
.findAll { it instanceof Map && it.type == 'basepower:tag_not_empty' }
.collect { it.tag as String } as Set<String>
Set<String> emptyGuards = conditions.findAll { it.type == 'poweradvantage:tag_empty' }
Set<String> emptyGuards = conditions.findAll { it.type == 'basepower:tag_empty' }
.collect { it.tag as String } as Set<String>
if (!(emptyGuards.intersect(guards)).isEmpty()) {
throw new GradleException("${recipeFile.path} requires the same tag to be empty and nonempty")
Expand Down Expand Up @@ -1179,10 +1185,10 @@ tasks.register('clientResourceProbeJar', Jar) {
// Optional coordinated play-test launch. The ordinary launch stays Power-only;
// these deobf jars are runtime inputs, never release contents or compile dependencies.
def advantageExtensionJars = [
steamadvantage: file(providers.gradleProperty('steamAdvantageDeobfJar').getOrElse(
'../SteamAdvantage/SteamAdvantage/build/libs-dev/SteamAdvantage-2.2.8.116051-deobf.jar')),
electricadvantage: file(providers.gradleProperty('electricAdvantageDeobfJar').getOrElse(
'../ElectricAdvantage/ElectricAdvantage/build/libs-dev/ElectricAdvantage-2.2.8.116051-deobf.jar'))
basesteam: file(providers.gradleProperty('steamAdvantageDeobfJar').getOrElse(
'../SteamAdvantage/SteamAdvantage/build/libs-dev/baseSteam-2.2.9.116051-deobf.jar')),
baseelectric: file(providers.gradleProperty('electricAdvantageDeobfJar').getOrElse(
'../ElectricAdvantage/ElectricAdvantage/build/libs-dev/baseElectric-2.2.9.116051-deobf.jar'))
]

tasks.register('prepareCombinedEclipseLaunch') {
Expand Down
Loading
Loading