Conversation
JEI moved the ingredient list overlay internals into the mezz.jei.gui.overlay.ingredients subpackage and changed the type of IngredientListOverlay#contents to the IIngredientListOverlayContents interface. The accessor mixins still referenced the old locations, so IngredientListOverlayMixin failed to apply and crashed the client as soon as JEI built its GUI. Update the accessor mixins to the new package layout and adjust JeiSupport accordingly. Since contents is now typed as an interface, the cast to IngredientGridWithNavigation is no longer guaranteed by the field type, so it is guarded with an instanceof check. PageNavigationMixin and MouseUtilMixin needed no changes: PageNavigation and MouseUtil are unchanged, and every accessed field kept its name. Closes MrCrayfish#633
This file contains hidden or 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
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.
Fixes the JEI integration crash reported in #633, on the
multiloader/1.21.1branch.Problem
With any JEI from
19.42.0.379onwards, the client crashes the moment JEI builds its GUI:JEI made two changes:
mezz.jei.gui.overlayinto themezz.jei.gui.overlay.ingredientssubpackage;IngredientListOverlay#contentsis now typed as theIIngredientListOverlayContentsinterface instead ofIngredientGridWithNavigation.IngredientGridMixinandIngredientGridWithNavigationMixintarget classes that no longer exist, so@Pseudomakes Mixin skip them with a warning.IngredientListOverlayMixinhowever targets a class that does still exist, so it is applied — and the accessor for the retyped field then fails hard, taking the client down.The last JEI release that still matches the current accessors is
19.27.0.346. Note that a class-level check is not enough to find the boundary:mezz.jei.gui.overlay.IngredientGridandIngredientGridWithNavigationstill exist up to19.39.0.372, butIngredientListOverlay#contentswas already retyped in19.32.0.358.Changes
IngredientListOverlayMixin—controllableGetContents()returnsIIngredientListOverlayContents.IngredientGridWithNavigationMixin,IngredientGridMixin— imports moved tomezz.jei.gui.overlay.ingredients.JeiSupport— imports updated; becausecontentsis now an interface, the cast toIngredientGridWithNavigationis no longer guaranteed by the field type, so it is guarded with aninstanceofcheck and bails out instead of throwing.jei_versionbumped to19.44.0.403.PageNavigationMixinandMouseUtilMixinare untouched —mezz.jei.gui.PageNavigationandmezz.jei.gui.input.MouseUtilare unchanged. Every accessed field kept its name (contents,configButton,navigation,ingredientGrid,ingredientListRenderer,nextButton,backButton), socontrollable.common.mixins.jsonneeds no changes either.Testing
Built locally and played on a Steam Deck: Minecraft 1.21.1, NeoForge 21.1.248, JEI 19.44.0.403, alongside Create, Sodium/Iris, Sophisticated Backpacks and others.
MixinApplyError,InvalidAccessorException, orSkipping virtual target mezz.jei..., anddebug.logconfirmsIngredientListOverlayMixinis actually applied tomezz.jei.gui.overlay.IngredientListOverlay.Other branches
multiloader/26.1.2andmultiloader/26.2carry the same breakage.multiloader/26.2has already started the migration — it importsIIngredientListOverlayContents— but still importsmezz.jei.gui.overlay.IngredientGridWithNavigation. Happy to port this across if that is useful.