Add support to create a pached Minecraft Jar on Startup#383
Add support to create a pached Minecraft Jar on Startup#383
Conversation
Last commit published: e7928868d85f4c81d0a3ce3625d263fd751474db - version: PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name = "Maven for PR #383" // https://github.com/neoforged/FancyModLoader/pull/383
url = uri("https://prmaven.neoforged.net/FancyModLoader/pr383")
content {
includeModule("net.neoforged.fancymodloader", "earlydisplay")
includeModule("net.neoforged.fancymodloader", "junit-fml")
includeModule("net.neoforged.fancymodloader", "loader")
}
}
} |
|
@shartte, this PR introduces breaking changes. Compatibility checks
|
|
@shartte, this pull request has conflicts, please resolve them for this PR to move forward. |
4af4974 to
d1f0f98
Compare
d1f0f98 to
8de2cce
Compare
…tion result. Allow the external discovery service to return null as a result, which indicates failure or disinterest with the discovery.
…eption with a cause is thrown.
…when logged to the console or log files by logging a cause.
Technici4n
left a comment
There was a problem hiding this comment.
Some comments are potentially inaccurate, to be double-checked later.
loader/src/main/java/net/neoforged/fml/ModLoadingException.java
Outdated
Show resolved
Hide resolved
...src/main/java/net/neoforged/neoforgespi/installation/GameDiscoveryOrInstallationService.java
Outdated
Show resolved
Hide resolved
loader/src/main/java/net/neoforged/fml/loading/EarlyServiceDiscovery.java
Outdated
Show resolved
Hide resolved
| public ModDiscoverer(ILaunchContext launchContext) { | ||
| this(launchContext, List.of()); | ||
| } | ||
| private final GameDiscoveryResult gameDiscoveryResult; |
There was a problem hiding this comment.
Technically we don't need to store it?
loader/src/main/java/net/neoforged/fml/loading/game/GameDiscovery.java
Outdated
Show resolved
Hide resolved
loader/src/main/java/net/neoforged/fml/loading/game/GameDiscovery.java
Outdated
Show resolved
Hide resolved
loader/src/main/java/net/neoforged/fml/loading/game/GameDiscovery.java
Outdated
Show resolved
Hide resolved
|
@shartte, this pull request has conflicts, please resolve them for this PR to move forward. |
# Conflicts: # loader/src/main/java/net/neoforged/fml/loading/game/GameDiscovery.java
…process before discovering mods.
…e they are not absolute
| api "net.neoforged:JarJarSelector:${jarjar_version}" | ||
| api "net.neoforged:JarJarMetadata:${jarjar_version}" | ||
| api("net.neoforged:bus:${eventbus_version}") | ||
| api("net.neoforged.installertools:binarypatch-applier:${installer_tools_version}") |
This PR will add support for automatically installing / producing the Minecraft jar if it is missing, assuming the installer is available in the libraries folder. This only applies to production and intends to replace https://github.com/PrismLauncher/ForgeWrapper for launchers.
The first phase of changes removes the locator for Minecraft/NeoForge and instead makes detecting "the game" an explicit first step, before FMLLoader is constructed. For this, most of the previous game locator code is moved into
net.neoforged.fml.loading.game.GameDiscovery. In the same vein,VersionInfois removed, since no CLI args except fml.neoForgeVersion are now required to launch. (no fml.mcVersion/fml.neoFormVersion) This information is now part of the NeoForge version properties file that is baked into NF.As previously, if an unobfuscated MC is detected on the classpath, FML assumes it is launching in development mode, and skips the production logic. This PR will change nothing about how development detection works. For production, two modes are supported: NF can be on the startup classpath, in which case not even the
fml.neoForgeVersionargument is required, or it can be loaded from the libraries folder.Assuming FML is launching production, and NF was found. FML then only has to check if the single patched Minecraft Jar exists within the libraries folder, using the detected NeoForge version. The artifact paths are:
net/neoforged/minecraft-client-patched/<neoForgeVersion>/minecraft-client-patched-<neoForgeVersion>.jar(and server, respectively).If it exists, launch just continues as before. If it does not exist, and a system property for auto-installation is set, FML will proceed with the auto-installation.
The pre-requisite PRs for this were: