ZekerZhayard / ForgeWrapper

Allow MultiMC to launch Minecraft 1.13+ with Forge
MIT License
52 stars 17 forks source link

Implement support for NeoForge #13

Closed Tkain closed 1 year ago

Tkain commented 1 year ago

This PR allows for ForgeWrapper to launch NeoForge just as it launches Minecraft Forge. This is mainly accomplished using Forge's fml.forgeGroup launch argument, which specifies the base path of Forge-related packages; for Minecraft Forge, this has always been net.minecraftforge, whereas NeoForge could use net.neoforged. With this PR, ForgeWrapper now stores the value of this flag and uses it when determining the path to the Forge installer.

Additionally, this PR fixes a bug preventing ForgeWrapper from compiling on Java versions newer than Java 8, which I found useful developing using Java 17.

Resolves #12.

Tkain commented 1 year ago

Now that I've come across concrete proof of it, I should also acknowledge that NeoForge's version of FML doesn't actually use the fml.forgeGroup flag for anything anymore; only the original Minecraft Forge's FML uses it. I'm open to changing things if this is unsuitable for distinguishing Forge and NeoForge, but it'll probably take extra work.

Tkain commented 1 year ago

I'd say the PR is feature-complete now, so I'm un-marking it as a draft. That said, there is still one lingering issue I haven't been able to figure out during development, but I'm not sure if it's related to the PR or not; when launching an installed NeoForge instance, NeoForge crashes because it can't find its built-in language providers. From what I've investigated regarding the issue, for whatever reason the language provider classes don't end up in FancyModLoader's class loader despite being on the classpath. Classic Forge works as expected, however.

I'll update the PR with a fix if I can find one out, but I've had no luck over the last two days.

Edit: This (hopefully) might be just a NeoForge bug; see https://github.com/neoforged/NeoForge/pull/68.

ZekerZhayard commented 1 year ago

In response to your crashes, I'll look into it this weekend and discuss it when I have a definitive solution.

Tkain commented 1 year ago

No need! As of NeoForge version 47.1.60 (where the bug I mentioned was fixed), NeoForge works as expected when installed using this PR!

Pyker commented 1 year ago

Can a release be created to push out these changes?

ZekerZhayard commented 1 year ago

@Pyker released

Pyker commented 1 year ago

Thanks!

Pyker commented 1 year ago

I confirm, it works just fine!