Skip to content

Commit

Permalink
Fix crash (MC 1.20.4)
Browse files Browse the repository at this point in the history
Signed-off-by: Hendrix-Shen <[email protected]>
  • Loading branch information
Hendrix-Shen committed Dec 24, 2023
1 parent a05e7bf commit 8c5adab
Showing 1 changed file with 45 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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
Expand All @@ -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);
Expand All @@ -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
}

0 comments on commit 8c5adab

Please sign in to comment.