Skip to content

Commit 46aec49

Browse files
committed
Qualify native Forge 1.11 packaged compatibility
1 parent 9d2b5f2 commit 46aec49

20 files changed

Lines changed: 410 additions & 82 deletions

File tree

‎build.gradle‎

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ def normalizeArchiveLineEndings = { details ->
102102
}
103103

104104
minecraft {
105+
if (gradle.startParameter.offline) {
106+
mavenizerArguments.add('--offline')
107+
}
105108
mappings channel: project.mapping_channel, version: project.mapping_version
106109
accessTransformer = 'META-INF/accesstransformer.cfg'
107110

@@ -112,7 +115,9 @@ minecraft {
112115
}
113116
register('client')
114117
register('server') {
115-
args '--nogui'
118+
// Forge 13's legacy launcher expects the bare trailing token used
119+
// by the official server command line: `java -jar forge.jar nogui`.
120+
args 'nogui'
116121
}
117122
}
118123
}
@@ -326,7 +331,12 @@ version_checking {
326331
}
327332
runOptions.workingDir.set(process.workingDir)
328333
run.workingDir(process.workingDir)
329-
run.args(process.args)
334+
// Preserve the target run's bare nogui argument while adding any
335+
// fixture-specific arguments. Replacing the argument list here
336+
// caused every automated Forge 1.11 server to open its Swing GUI.
337+
List<String> effectiveArgs = new ArrayList<>(originalArgs)
338+
effectiveArgs.addAll(process.args)
339+
run.setArgs(effectiveArgs)
330340
run.jvmArgs(process.jvmArgs)
331341
run.systemProperties(process.systemProperties)
332342
run.environment(process.environment)
@@ -1129,10 +1139,14 @@ task benchmarkIntegrationProcess(type: JavaExec, dependsOn: prepareWorldgenBench
11291139
}
11301140
configureFromForgeRun(delegate, 'runServer')
11311141
doLast {
1132-
File latest = new File(benchmarkRunDirectory, 'logs/latest.log')
11331142
String mode = project.findProperty('benchmarkMode') ?: 'sky'
1134-
if (!latest.isFile() || !latest.text.contains("ORESPAWN_BENCHMARK summary mode=${mode}")) {
1135-
throw new GradleException("Missing ${mode} worldgen benchmark summary: ${latest}")
1143+
String summary = "ORESPAWN_BENCHMARK summary mode=${mode}"
1144+
List<File> benchmarkLogs = [
1145+
new File(benchmarkRunDirectory, 'logs/fml-server-latest.log'),
1146+
new File(benchmarkRunDirectory, 'logs/latest.log')
1147+
]
1148+
if (!benchmarkLogs.any { it.isFile() && it.getText('UTF-8').contains(summary) }) {
1149+
throw new GradleException("Missing ${mode} worldgen benchmark summary in ${benchmarkLogs}")
11361150
}
11371151
assertRuntimeLogsClean(benchmarkRunDirectory, "${mode} worldgen benchmark")
11381152
}
@@ -1154,6 +1168,18 @@ tasks.named('processResources', ProcessResources) {
11541168
from('docs') {
11551169
into 'META-INF/orespawn/docs'
11561170
}
1171+
// Pack format 2 is wrapped by Minecraft 1.11's LegacyV2Adapter, which
1172+
// translates a requested lower-case locale such as en_us.lang to the
1173+
// pre-1.11 en_US.lang spelling. Keep the canonical lower-case sources but
1174+
// use target-runtime names in processed production resources. Renaming the
1175+
// single copy also keeps Windows and case-sensitive CI archives identical.
1176+
filesMatching('assets/orespawn/lang/*.lang') {
1177+
def locale = name =~ /^([a-z]{2})_([a-z]{2})\.lang$/
1178+
if (!locale.matches()) {
1179+
throw new GradleException("Unexpected locale file name: ${name}")
1180+
}
1181+
name = "${locale.group(1)}_${locale.group(2).toUpperCase(java.util.Locale.ROOT)}.lang"
1182+
}
11571183
filesMatching(archiveTextPatterns, normalizeArchiveLineEndings)
11581184
}
11591185

@@ -1600,6 +1626,20 @@ tasks.register('verifyReleaseArtifacts') {
16001626
throw new GradleException("Release jar is missing ${required}")
16011627
}
16021628
}
1629+
fileTree('src/main/resources/assets/orespawn/lang') {
1630+
include '*.lang'
1631+
}.files.each { File source ->
1632+
def locale = source.name =~ /^([a-z]{2})_([a-z]{2})\.lang$/
1633+
if (!locale.matches()) {
1634+
throw new GradleException("Unexpected locale file name: ${source.name}")
1635+
}
1636+
String alias = "${locale.group(1)}_${locale.group(2).toUpperCase(java.util.Locale.ROOT)}.lang"
1637+
def entry = zip.getEntry("assets/orespawn/lang/${alias}")
1638+
if (entry == null || !java.util.Arrays.equals(source.bytes,
1639+
zip.getInputStream(entry).withCloseable { it.bytes })) {
1640+
throw new GradleException("Packaged LegacyV2 locale alias differs for ${alias}")
1641+
}
1642+
}
16031643
List<File> trackedDocs = trackedDocumentationFiles()
16041644
if (trackedDocs.size() != 21) {
16051645
throw new GradleException("Expected 21 tracked documentation files, found ${trackedDocs.size()}")

‎ci-fixtures/README.md‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1-
# Forge 1.12.2 CI fixtures
1+
# Forge 1.11.2 CI fixtures
22

33
These exact published Mineralogy engines and the sealed generated OS3 world
4-
make the Forge 1.12.2 migration and parity checks self-contained on hosted CI.
4+
make the Forge 1.11.2 migration and parity checks self-contained on hosted CI.
55
They are test inputs only and must never enter an OreSpawn release artifact or
66
an ordinary Eclipse launch.
77

88
- `Mineralogy-1.10.2-3.3.8.26.jar` is the carried 1.10 Cyano-engine oracle.
9+
- `Mineralogy-1.11.2-3.3.0.jar` is the native 1.11 Cyano-engine oracle rebuilt
10+
from exact Mineralogy source commit
11+
`727fec4c8fd9d874bf480c74ccd868804021137b`.
912
- `Mineralogy-1.12.2-3.8.0.53.jar` is the native 1.12 Cyano-engine oracle.
13+
- `OreSpawn-1.11.2-3.2.2.jar` is the target-native OS3 ABI fixture rebuilt
14+
from dormant-branch commit
15+
`67ea7aebe766f00c1b7fe46488a5e0ab31e5cc6c`.
16+
- `OreSpawn_1.10.2-1.1.0.jar` is the inherited published OS1 ABI fixture.
1017
- `os3-331-default-source.zip` is the immutable generated-world source used by
11-
both legacy-lineage fresh/reload gates.
18+
the legacy-lineage fresh/reload gates.
19+
20+
Both 1.11 jars were built with their historical Gradle 4.9 wrappers and exact
21+
Temurin 8.0.502+7. The source trees were detached at the commits above. Only
22+
obsolete CurseGradle/Sonar configuration was removed from the disposable
23+
build scripts; no production source or resource was changed. The resulting
24+
ordinary `jar` output was copied here, hashed, and is loaded only by isolated
25+
test class loaders or explicit compatibility tasks.
1226

1327
`SHA256SUMS` is authoritative. The Gradle build verifies every hash before
1428
compiling tests or starting a migration runtime.

‎ci-fixtures/SHA256SUMS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
88A6237C9A0E2C8891718B68C373E741C78B8494F5E68D8093CA9339F3BC4D87 artifacts/Mineralogy-1.10.2-3.3.8.26.jar
2+
5737C0FA65CB334D191FCD147B4FB16C26823F8EE9882E70A6888E32DA8A9440 artifacts/Mineralogy-1.11.2-3.3.0.jar
23
C42E608E5662A94138BD2461019D33283F96E3FB66E28DB91C00A49E9A8005CD artifacts/Mineralogy-1.12.2-3.8.0.53.jar
4+
8CAB9D60C988C6239FCFCAC4AF7886E63A77BD97A1FDFD82DE5EBE30987F9614 artifacts/OreSpawn-1.11.2-3.2.2.jar
5+
91345E4B825AA06E05F470066F467AABA0C7A2804A8DBCA4D3CD1905ED53607C artifacts/OreSpawn_1.10.2-1.1.0.jar
36
2852FA549C7A952CCC0EAE1454057CA81BD91F5BB323BEA1030452BB1D82FDFD worlds/os3-331-default-source.zip
142 KB
Binary file not shown.
23.4 KB
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.mcmoddev.orespawn;
2+
3+
import com.mcmoddev.orespawn.api.os3.OS3API;
4+
import com.mcmoddev.orespawn.api.plugin.IOreSpawnPlugin;
5+
import com.mcmoddev.orespawn.api.plugin.OreSpawnPlugin;
6+
7+
/** Exact Forge 1.11 Base Metals OreSpawn plugin contract from commit f6ceb967. */
8+
@OreSpawnPlugin(modid = "basemetals", resourcePath = "orespawn")
9+
public class BaseMetalsOreSpawn implements IOreSpawnPlugin {
10+
@Override
11+
public void register(OS3API apiInterface) {
12+
// The historical provider is declarative and is read from the jar.
13+
}
14+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package zone.moddev.mc.orespawn.basemetals111;
2+
3+
import net.minecraft.block.Block;
4+
import net.minecraft.block.material.Material;
5+
import net.minecraftforge.event.RegistryEvent;
6+
import net.minecraftforge.fml.common.Mod;
7+
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
8+
9+
/** Minimal block registry around the exact historical Base Metals provider. */
10+
@Mod(modid = BaseMetals111Fixture.MODID, name = "Base Metals 1.11 Provider Fixture",
11+
version = "2.5.0-beta", acceptableRemoteVersions = "*")
12+
@Mod.EventBusSubscriber(modid = BaseMetals111Fixture.MODID)
13+
public final class BaseMetals111Fixture {
14+
public static final String MODID = "basemetals";
15+
private static final String[] ORES = {
16+
"coldiron_ore", "adamantine_ore", "starsteel_ore", "copper_ore",
17+
"silver_ore", "tin_ore", "lead_ore", "zinc_ore", "mercury_ore",
18+
"nickel_ore", "platinum_ore"
19+
};
20+
21+
public BaseMetals111Fixture() { }
22+
23+
@SubscribeEvent
24+
public static void registerBlocks(RegistryEvent.Register<Block> event) {
25+
for (String name : ORES) {
26+
event.getRegistry().register(new Block(Material.ROCK)
27+
.setRegistryName(MODID, name).setUnlocalizedName(MODID + "." + name));
28+
}
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"version": 1,
3+
"dimensions": [
4+
{
5+
"dimension": -1,
6+
"ores": [
7+
{"block":"basemetals:coldiron_ore","parameters":{"size":8,"variation":4,"frequency":5.0,"minHeight":0,"maxHeight":128},"feature":"default","replace_block":"default"},
8+
{"block":"basemetals:adamantine_ore","parameters":{"size":8,"variation":4,"frequency":2.0,"minHeight":0,"maxHeight":128},"feature":"default","replace_block":"default"}
9+
]
10+
},
11+
{
12+
"dimension": 1,
13+
"ores": [
14+
{"block":"basemetals:starsteel_ore","parameters":{"size":8,"variation":4,"frequency":5.0,"minHeight":0,"maxHeight":255},"feature":"default","replace_block":"default"}
15+
]
16+
},
17+
{
18+
"ores": [
19+
{"block":"basemetals:copper_ore","parameters":{"size":8,"variation":4,"frequency":10.0,"minHeight":0,"maxHeight":96},"feature":"default","replace_block":"default"},
20+
{"block":"basemetals:silver_ore","parameters":{"size":8,"variation":4,"frequency":4.0,"minHeight":0,"maxHeight":32},"feature":"default","replace_block":"default"},
21+
{"block":"basemetals:tin_ore","parameters":{"size":8,"variation":4,"frequency":10.0,"minHeight":0,"maxHeight":128},"feature":"default","replace_block":"default"},
22+
{"block":"basemetals:lead_ore","parameters":{"size":8,"variation":4,"frequency":5.0,"minHeight":0,"maxHeight":64},"feature":"default","replace_block":"default"},
23+
{"block":"basemetals:zinc_ore","parameters":{"size":8,"variation":4,"frequency":5.0,"minHeight":0,"maxHeight":96},"feature":"default","replace_block":"default"},
24+
{"block":"basemetals:mercury_ore","parameters":{"size":8,"variation":4,"frequency":3.0,"minHeight":0,"maxHeight":32},"feature":"default","replace_block":"default"},
25+
{"block":"basemetals:nickel_ore","parameters":{"size":8,"variation":4,"frequency":1.0,"minHeight":32,"maxHeight":96},"feature":"default","replace_block":"default"},
26+
{"block":"basemetals:platinum_ore","parameters":{"size":8,"variation":4,"frequency":0.125,"minHeight":1,"maxHeight":32},"feature":"default","replace_block":"default"}
27+
]
28+
}
29+
]
30+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"modid":"basemetals","name":"Base Metals 1.11 Provider Fixture","description":"Build-only historical provider fixture","version":"2.5.0-beta","mcversion":"1.11.2"}]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"pack":{"description":"Base Metals 1.11 provider fixture","pack_format":2}}

0 commit comments

Comments
 (0)