88import net .minecraft .client .gui .ScaledResolution ;
99import net .minecraftforge .client .GuiIngameForge ;
1010
11+ import com .llamalad7 .mixinextras .injector .wrapoperation .Operation ;
12+ import com .llamalad7 .mixinextras .injector .wrapoperation .WrapOperation ;
1113import org .spongepowered .asm .mixin .Mixin ;
1214import org .spongepowered .asm .mixin .injection .At ;
13- import org .spongepowered .asm .mixin .injection .Redirect ;
1415
1516@ Mixin (GuiIngameForge .class )
1617public class GuiIngameForgeMixin extends GuiIngame {
@@ -19,13 +20,13 @@ private GuiIngameForgeMixin(Minecraft mcIn) {
1920 super (mcIn );
2021 }
2122
22- @ Redirect (method = "renderToolHighlight" ,
23- at = @ At (value = "INVOKE" ,
24- target = "Lnet/minecraft/client/gui/ScaledResolution;getScaledHeight()I" ))
25- private int shiftToolHighlightText (ScaledResolution res ) {
23+ @ WrapOperation (method = "renderToolHighlight" ,
24+ at = @ At (value = "INVOKE" ,
25+ target = "Lnet/minecraft/client/gui/ScaledResolution;getScaledHeight()I" ))
26+ private int shiftToolHighlightText (ScaledResolution resolution , Operation < Integer > op ) {
2627 if (ConfigHolder .client .toolbeltConfig .enableToolbeltHotbarDisplay &&
2728 highlightingItemStack .getItem () instanceof ItemGTToolbelt )
28- return res . getScaledHeight ( ) - 31 + 6 ;
29- else return res . getScaledHeight ( );
29+ return op . call ( resolution ) - 31 + 6 ;
30+ else return op . call ( resolution );
3031 }
3132}
0 commit comments