Skip to content

Conversation

@Johni0702
Copy link
Contributor

See individual commits.
ML11 is required for NeoForge 1.21 (LexForge stayed on its fork of ML10).
KFF5 is required for 1.20.6+ (and is the only thing required for Forge 1.20.6+).

Former is Forge specific, latter is ModLauncher specific, and while they
tend to change at the same time, that'll no longer be true once we also
consider NeoForge.
Newer Forge versions will put inner jars (such as Kotlin inside KFF) on
a layer which depends on the outer jar (KFF), which may be different
than what one would expect from just looking at the Kotlin jar.
As such we can no longer determine the layer ahead of time and will
instead assume that layers are built in order, and just assume whichever
layer is the most recent one.
Note that we cannot easily just check which layer our SecureJar is in
because it may be further wrapped by e.g. KFFMerger and as such may not
directly appear in any of the lists at all.
Will be required for KFF5 which uses JarJar, so we want to emit all our
Kotlin jars separately instead of merging them into the outer jar.
@github-actions
Copy link

github-actions bot commented Feb 13, 2025

Test Results

16 files  ±0  16 suites  ±0   11m 40s ⏱️ -12s
95 tests ±0  95 ✅ ±0  0 💤 ±0  0 ❌ ±0 
99 runs  ±0  99 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 8dae5d4. ± Comparison against base commit f75128a.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@DJtheRedstoner DJtheRedstoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, pending appropriate testing

// ModLauncher somehow manages to report the version of some jars (really unsure which ones, best guess
// right now is all those without a `FMLModType` manifest attribute? seemingly completely irregardless of
// whether they have an `Implementation-Version` attribute!)
// as "Optional.empty" (yes, that's a String, somewhere someone must have blindly `toString`ed).
Copy link
Contributor

@DJtheRedstoner DJtheRedstoner Mar 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was fixed here, but not in forge's fork (not exactly sure what causes it, but definitely only affects modular jars, i.e. those with module-info.class). For present values Optional#toString does wrap the inner toString in Optional[], does this affect anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, while I haven't ever observed a non-empty one (looking at the Java spec, there doesn't even appear to be a way to set your module's version, you have to manually tell Gradle to add it, so predicatively most people just don't have one set; only 270 search results in all of GitHub), we should definitely go unwrap those in case a future version of any of the libs we care about ends up doing it.
Now that I'm looking at the source of that bug, and the fact that it's been fixed in NeoForge, I realize that we should probably also remove the early if (version == null) return FALLBACK_VERSION; given there's a non-negligible chance that it might show up if they change something in their mod loading such that that class actually gets used for one of the libs we care about.

@Johni0702
Copy link
Contributor Author

(will re-order the release commits to be after this new commit before merge)

@Johni0702 Johni0702 requested a review from DJtheRedstoner April 2, 2025 14:23
There are really two independent issues, the `toString` and the fact
that it returns no version, which may happen independently.
As such, this commit also unwraps the `toString` result of non-empty
`Optional`s, and runs the fallback version reading code when the raw
version reported is already `null`.
@Johni0702 Johni0702 merged commit 2b35cce into master Apr 7, 2025
3 checks passed
@Johni0702 Johni0702 deleted the feature/neoforge branch April 7, 2025 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants