Closed tie closed 3 years ago
Something has screrwed up your class order. The Minecraft/Forge jar should be the first thing on the path before MergeTool API. But also, 1.12 still isn't technically supported, so you're gunna have to look into it on your own or hope someone comes along that cares to look into it.
Thanks for the hint! I totally forgot I could have used sourcegraph to find where BUKKIT comes from.
That said, FML prints class path on launch and there forge jar appears before MergeTool.
The following exception during the initial build looks suspicious.
So I guess net/minecraftforge/fml/relauncher/Side.class
class from MergeTool somehow ends up in …/minecraft_user_repo/…/forge-1.12.2-14.23.5.2855_mapped_stable_39-1.12.jar
. Jumping to definition of Side class from NetworkRegistry in IntelliJ kinda proves that suspicion.
So the exception during initial build is caused by https://github.com/TheCBProject/DiffPatch/issues/3 which I think should be fixed in 4.0.16. I’ll try building with that release.
OK, so another exception here with FG ≥4.0.16.
java.lang.RuntimeException: Failed to apply patches to source file, see log for details: ~/.gradle/caches/forge_gradle/minecraft_user_repo/net/minecraftforge/forge/1.12.2-14.23.5.2855/forge-1.12.2-14.23.5.2855-decomp.jar
I’m not exactly sure which log I should see.
If you are going to be trying to get this to run on 1.12, I recommend using 4.0.18 not 4.0.14-4.0.17 as there were various issues those had, at least in modern MC, so I would not be surprised if they also had issues with 1.12
Not sure if this is intentional: should --output
file contain relauncher.Side enum including BUKKIT case?
2021-02-21T16:10:05.721+0300 [LIFECYCLE] [org.gradle.api.Project] > Running 'merge'
2021-02-21T16:10:05.770+0300 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command '/Users/tie/Library/Java/JavaVirtualMachines/openjdk-15.0.2/Contents/Home/bin/java''. Working directory: /Users/tie/.gradle/caches/forge_gradle/mcp_repo/de/oceanlabs/mcp/mcp_config/1.12.2/joined/merge Command: /Users/tie/Library/Java/JavaVirtualMachines/openjdk-15.0.2/Contents/Home/bin/java -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /Users/tie/.gradle/caches/forge_gradle/maven_downloader/net/minecraftforge/mergetool/0.2.3.2/mergetool-0.2.3.2-fatjar.jar net.minecraftforge.mergetool.ConsoleMerger --client /Users/tie/.gradle/caches/forge_gradle/mcp_repo/de/oceanlabs/mcp/mcp_config/1.12.2/joined/stripClient/output.jar --server /Users/tie/.gradle/caches/forge_gradle/mcp_repo/de/oceanlabs/mcp/mcp_config/1.12.2/joined/stripServer/output.jar --ann 1.12.2 --output /Users/tie/.gradle/caches/forge_gradle/mcp_repo/de/oceanlabs/mcp/mcp_config/1.12.2/joined/merge/output.jar
Ugh, looks like GitHub can’t soft-wrap code blocks…
java -cp mergetool-0.2.3.2-fatjar.jar net.minecraftforge.mergetool.ConsoleMerger \
--client stripClient/output.jar \
--server stripServer/output.jar \
--ann 1.12.2 \
--output merge/output.jar
@pupnewfster yeah, thanks! Already trying to figure out what’s broken using FG 4.0.18.
Not sure if this is intentional: should
--output
file contain relauncher.Side enum including BUKKIT case?
Yes
So after getting a sleep and running a clean build with fg.debugRepo=true
, it looks like source patches are not applied.
How does the new implementation handle path prefixes? Patches in 1.12 have ../src-base/minecraft/
and ../src-work/minecraft/
prefixes and looking at the code I can only find a/
and b/
. Perhaps diff4j was smart enough to figure that out.
For reference, here is the the code that throws runtime exception which is then “handled” in repo.
If I had to guess, I would assume that it's because of the switch from Diff4J to DiffPatch; I don't know exactly but I assume that it was only tested with 1.16.5 and 1.15.2 (as they're the currently supported versions of Forge). What I suspect is that Diff4J did not look at the headers when patching, while DiffPatch does and therefore refuses to patch the files because of the mismatch.
Looking at the commit https://github.com/MinecraftForge/ForgeGradle/commit/a74f4b155d3c41f495e4e03398ead9a95ef831f8#diff-4eae5771feb04a6b5b33c29767365a6f10e2fe2eede031fa56d4819f24d432f7L1029-R1052
In particular, lines 1036–1037 were removed
String prefixO = parent.getConfigV2() == null ? null : parent.getConfigV2().patchesOriginalPrefix;
String prefixM = parent.getConfigV2() == null ? null : parent.getConfigV2().patchesModifiedPrefix;
The log on old version shows that these are not no-op.
Apply Patches: net.minecraftforge:forge:1.12.2-14.23.5.2855:userdev3
Original Prefix: ../src-base/minecraft/
Modified Prefix: ../src-work/minecraft/
So adding something like the following before .build()
invocation should help with that particular error (not sure whether it’ll will solve the whole issue though).
UserdevConfigV2 cfg = parent.getConfigV2();
if (cfg != null) {
opBuilder = opBuilder
.aPrefix(cfg.patchesOriginalPrefix)
.bPrefix(cfg.patchesOriginalPrefix)
}
Can confirm that FG 4.0.19 works with MC 1.12.2 :tada:
Although IDEA does some Gradle magic incantations on project import because I can’t just run gradle runClient
from command line with clean caches (i.e. git clean -xfd; rm -rf ~/.gradle
). But I believe that was happening with 4.0.13 too so not related.
Using FG 4.0.14 a74f4b155d3c41f495e4e03398ead9a95ef831f8 #710 (or later) and running
runClient
task withnet.minecraftforge:forge:1.12.2-14.23.5.2855
crashes with the following exception:Stack trace
``` net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Forge Mod Loader (FML) Caused by: java.lang.NullPointerException at net.minecraftforge.fml.common.network.NetworkRegistry.newChannel(NetworkRegistry.java:207) at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.registerChannel(FMLNetworkHandler.java:185) at net.minecraftforge.fml.common.FMLContainer.modConstruction(FMLContainer.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:595) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232) at net.minecraft.client.Minecraft.init(Minecraft.java:467) at net.minecraft.client.Minecraft.run(Minecraft.java:378) at net.minecraft.client.main.Main.main(SourceFile:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.legacydev.Main.start(Main.java:86) at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) ```Apparently something adds
BUKKIT
to net.minecraftforge.fml.relauncher.Side enum and NetworkRegistry iterates overSide.values()
innewChannel
but not in constructor.That said, I have no idea how did a74f4b155d3c41f495e4e03398ead9a95ef831f8 break that part and where Side.BUKKIT comes from.