YUNG's Menu Tweaks (Forge)

YUNG's Menu Tweaks (Forge)

5M Downloads

[1.20.1] Mixin crash when installed with Configured

MrCrayfish opened this issue ยท 2 comments

commented

Hey Nick, I've tracked a mixin crash (MrCrayfish/Configured#119) down to Configured and your mod. I noticed that you have used a @Redirect in order to override the blit call to render the background texture of AbstractSelectionList. This is causing issues with anything that targets the same blit call with @ModifyArg. I've adapted your code to use @ModifyArg instead which will resolve the issue. Feel free to copy it.

@Mixin(AbstractSelectionList.class)
public class AbstractSelectionListMixin {
    @ModifyArg(method = "render(Lnet/minecraft/client/gui/GuiGraphics;IIF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lnet/minecraft/resources/ResourceLocation;IIFFIIII)V"), index = 0)
    public ResourceLocation yungsmenutweaks_changeSelectionListBackground(ResourceLocation original) {
        if(YungsMenuTweaksCommon.CONFIG.enableBackgroundTexture && original.equals(Screen.BACKGROUND_LOCATION)) {
            return YungsMenuTweaksCommon.CONFIG.backgroundTexture;
        }
        return original;
    }
}

Cheers

commented

Yo! Sorry about the invasive mixin, and thanks for the help. I've gone ahead and implemented your ModifyArg approach in v1.0.2. I've also made the same change to the ExperimentsScreenMixin class as well. Did some quick testing and didn't get a crash, but I'll leave this open for you to close upon confirming the crash is fixed.

Thanks again for the help!

commented

Thanks for the quick response and getting a patch out so soon. I've confirmed the update has resolved the issue.