diff --git a/src/main/java/top/hendrixshen/tweakmyclient/mixin/feature/featureCustomSidebarBackgroundColor/MixinGui.java b/src/main/java/top/hendrixshen/tweakmyclient/mixin/feature/featureCustomSidebarBackgroundColor/MixinGui.java index 77355bb..ad7e403 100644 --- a/src/main/java/top/hendrixshen/tweakmyclient/mixin/feature/featureCustomSidebarBackgroundColor/MixinGui.java +++ b/src/main/java/top/hendrixshen/tweakmyclient/mixin/feature/featureCustomSidebarBackgroundColor/MixinGui.java @@ -10,7 +10,11 @@ @Mixin(Gui.class) public abstract class MixinGui { @ModifyArgs( - method = "displayScoreboardSidebar", + //#if MC > 12002 + method = "method_55440", + //#else + //$$ method = "displayScoreboardSidebar", + //#endif at = @At( value = "INVOKE", //#if MC > 11904 @@ -20,7 +24,11 @@ public abstract class MixinGui { //#else //$$ target = "Lnet/minecraft/client/gui/Gui;fill(IIIII)V", //#endif - ordinal = 1 + //#if MC > 12002 + ordinal = 0 + //#else + //$$ ordinal = 1 + //#endif ) ) private void changeSidebarTitleBackgroundColor(Args args) { @@ -34,31 +42,11 @@ private void changeSidebarTitleBackgroundColor(Args args) { } @ModifyArgs( - method = "displayScoreboardSidebar", - at = @At( - value = "INVOKE", - //#if MC > 11904 - target = "Lnet/minecraft/client/gui/GuiGraphics;fill(IIIII)V", - //#elseif MC > 11502 - //$$ target = "Lnet/minecraft/client/gui/Gui;fill(Lcom/mojang/blaze3d/vertex/PoseStack;IIIII)V", - //#else - //$$ target = "Lnet/minecraft/client/gui/Gui;fill(IIIII)V", - //#endif - ordinal = 0 - ) - ) - private void changeSidebarContentBackgroundColor_1(Args args) { - if (Configs.featureCustomSidebarBackgroundColor) { - //#if MC > 11502 && MC < 12000 - //$$ args.set(5, Configs.colorSidebarContent.intValue); + //#if MC > 12002 + method = "method_55440", //#else - args.set(4, Configs.colorSidebarContent.intValue); + //$$ method = "displayScoreboardSidebar", //#endif - } - } - - @ModifyArgs( - method = "displayScoreboardSidebar", at = @At( value = "INVOKE", //#if MC > 11904 @@ -68,10 +56,14 @@ private void changeSidebarContentBackgroundColor_1(Args args) { //#else //$$ target = "Lnet/minecraft/client/gui/Gui;fill(IIIII)V", //#endif - ordinal = 2 + //#if MC > 12002 + ordinal = 1 + //#else + //$$ ordinal = 0 + //#endif ) ) - private void changeSidebarContentBackgroundColor_2(Args args) { + private void changeSidebarContentBackgroundColor_1(Args args) { if (Configs.featureCustomSidebarBackgroundColor) { //#if MC > 11502 && MC < 12000 //$$ args.set(5, Configs.colorSidebarContent.intValue); @@ -80,4 +72,30 @@ private void changeSidebarContentBackgroundColor_2(Args args) { //#endif } } + + //#if MC < 12002 + //$$ @ModifyArgs( + //$$ method = "displayScoreboardSidebar", + //$$ at = @At( + //$$ value = "INVOKE", + //#if MC > 11904 + //$$ target = "Lnet/minecraft/client/gui/GuiGraphics;fill(IIIII)V", + //#elseif MC > 11502 + //$$ target = "Lnet/minecraft/client/gui/Gui;fill(Lcom/mojang/blaze3d/vertex/PoseStack;IIIII)V", + //#else + //$$ target = "Lnet/minecraft/client/gui/Gui;fill(IIIII)V", + //#endif + //$$ ordinal = 2 + //$$ ) + //$$ ) + //$$ private void changeSidebarContentBackgroundColor_2(Args args) { + //$$ if (Configs.featureCustomSidebarBackgroundColor) { + //#if MC > 11502 && MC < 12000 + //$$ args.set(5, Configs.colorSidebarContent.intValue); + //#else + //$$ args.set(4, Configs.colorSidebarContent.intValue); + //#endif + //$$ } + //$$ } + //#endif }