-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fabric 1.21 Support #874
Merged
Merged
Fabric 1.21 Support #874
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Updated: Gradle Wrapper 8.5 -> 8.7 (Required by Fabric Loom) Removed: parchmentmc (Fabric Loom provides native support for Parchment mappings as of version 0.9) Changed: Fabric Dependency id from fabric -> fabric-api (see: https://fabricmc.net/2022/11/24/1193.html)
…ndency Re-added: Parchment (mixed something up) Fixed: Compile issue with removed class import
We're leaving this PR open in case anyone is willing to work on backwards compatibility, but backwards compatibility is not priority for platforms other than Spigot FYI. If no one cares about that, we'll just merge it :) |
Thanks for this. |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fabric 1.21 Support
Description
Between versions 1.20 and 1.21, there have been multiple changes to the
configureSerialization
method in thePacketEventsInjectorMixin
class. TheconfigureSerialization
method now requires additional parameters:boolean memoryOnly
andBandwidthDebugMonitor bandwidthDebugMonitor
. This change causes anInvalidInjectionException
upon startup, resulting in a difficult-to-follow stack trace in the console.I discovered the missing parameters when updating to version 1.21, as my IDE indicated missing constructor parameters. Additionally, updating to the latest version required several Gradle adjustments to resolve dependencies properly.
Tasks
PacketEventsInjectorMixin
for version 1.21fabric
tofabric-api
0.11-SNAPSHOT
to1.7.2
8.1.1
to8.1.8
(adds Java 21 support, needed for Fabric and probably Sponge in the future)net.minecraft.network.chat.contents.LiteralContents
import inPacketEventsMod
as theLiteralContents
class no longer exists (unused import)Shadow Googler
Initially, I planned to create a separate PR for the shadow plugin update. However, I encountered an issue that justified including it in this pull request. If necessary, I can create a separate PR for this change.
Johnrengelman's shadow plugin lacks support for Java 21 and hasn't been updated recently. This support is crucial for Fabric Loom to merge mappings into the final PE Fabric build. Most projects, including PaperMC, have switched to Googler's shadow fork, which does not introduce breaking changes. For more information, see: GradleUp/shadow#908
Backward Compatibility
The updated
configureSerialization
method in thePacketEventsInjectorMixin
requires two new parameters, causingInvalidInjectionException
in older versions due to unrecognized parameters. We need a solution to support both the previous and newer versions.Fabric Mod ID Change
As of Minecraft
1.19.2
, Fabric API's mod ID has changed from fabric to fabric-api. When backporting from1.19.2
to earlier versions, you must alter the depends section of yourfabric.mod.json
to expectfabric
.I updated our internal dependency from
fabric
tofabric-api
so it now properly resolves the Fabric API on recent versions.