Skip to content
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

Add support for Quilt Loader and QSL/QFAPI #988

Draft
wants to merge 2 commits into
base: llama
Choose a base branch
from

Conversation

XXMA16
Copy link

@XXMA16 XXMA16 commented Mar 7, 2023

Might not be ready for merge

The goal of this PR is to allow players to use Quilt Loader + QSL alongside Optifabric without causing any additional issues compared to using Fabric Loader + Fabric API.

closes #751 and #899

Note: I will be calling Quilt Standard Libraries/Quilted Fabric API the same since, although they are different repos, there exists a single mod implementation.

I tested the following versions with Quilt Loader 0.17.11 and 0.18.3 and I haven't encountered any issues:

  • 1.19.3 + QSL 4.0.0 + I2_pre5
  • 1.19.2 + QSL 3.0.0 + H9
  • 1.18.2 + QSL 1.1.0 + H7
  • 1.16.5 + FAPI 0.42.0 + G7
  • 1.16.1 + FAPI 0.18.0 + G2

The versions in italics seem to start extremely slowly when using Quilt Loader 0.17.* or 0.16.1. I have not tested all of the loader versions, however it seems the startup is painfully slow on anything <0.18.
QSL exists only for versions >=1.18.2

Overcoming issues

  1. Getting the game to start
    The main problem with running Optifabric on Quilt Loader was its reliance on deprecated internal Fabric Loader APIs. By checking if Quilt is present and, if so, not using those internal APIs, this issue can be easily circumvented, allowing the game to start normally.

  2. Getting Quilt Standard Libraries to work
    QSL makes use mostly of Fabric API mixins, so there aren't many issues to fix (in theory at least).

  • QSL Screen replaces Fabric's Screen API and as such its GameRendererMixin requires its own InterceptingMixin due to slightly different onBeforeRenderScreen and onAfterRenderScreen callback injectors.
  • QSL's Item Extension API gets messed up by Optifine changing all instances of ItemStack.isOf(Items.CROSSBOW) to instanceof CrossbowItem inside the renderFirstPersonItem method. HeldItemRendererFix replaces the Optifine method with the vanilla one and re-adds Optifine's check Shaders.isSkipRenderHand at the head of the method. As far as I noticed, Optifine doesn't add any other behavioural changes. HeldItemRendererFix will run whether or not QSL is present at runtime.
  • When checking the version of a Fabric API mod fabric-x the version of quilted_fabric_x will be returned instead. As such, OptifabricSetup will explicitly check if the quilted version of the mod is present, without checking the version, because even the lowest QSL mod version is based on a Fabric API version whose modules satisfy every version check in OptifabricSetup

@XXMA16 XXMA16 closed this Mar 8, 2023
@XXMA16 XXMA16 deleted the quilt-support branch March 8, 2023 15:16
@XXMA16 XXMA16 reopened this Mar 8, 2023
@R00tB33rMan
Copy link

After some testing, everything appears to work correctly except for HandItemRendering, which initiates a crash when eating food and drawing an arrow (for instance) on 1.19.4. I’m assuming it all works accordingly on 1.19.3 and below, when testing was conducted. Just thought I should throw this out there, in case you wanted to make any modifications to this PR. Other than this issue, I haven’t been able to identify any other conflicts that this PR poses.

@TheUnknownCod3r
Copy link

#1116 will also be closed by this PR when ready / if merged.

@XXMA16 XXMA16 force-pushed the quilt-support branch 4 times, most recently from a4d4cc3 to b6e4f7c Compare August 13, 2023 19:52
@XXMA16
Copy link
Author

XXMA16 commented Aug 13, 2023

Note to self: rebase is evil

@XXMA16 XXMA16 marked this pull request as draft August 29, 2023 18:18
@3gf8jv4dv 3gf8jv4dv mentioned this pull request Jul 10, 2024
8 tasks
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.

Quilt support?
4 participants