@@ -81,15 +81,15 @@ public abstract class InGameHudMixin {
8181 @ Inject (method = "renderStatusEffectOverlay" , at = @ At ("HEAD" ), cancellable = true )
8282 public void axolotlclient$renderStatusEffect (GuiGraphics graphics , CallbackInfo ci ) {
8383 PotionsHud hud = (PotionsHud ) HudManager .getInstance ().get (PotionsHud .ID );
84- if (hud != null && hud .isEnabled ()) {
84+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
8585 ci .cancel ();
8686 }
8787 }
8888
8989 @ Inject (method = "renderCrosshair" , at = @ At ("HEAD" ), cancellable = true )
9090 public void axolotlclient$renderCrosshair (GuiGraphics graphics , CallbackInfo ci ) {
9191 CrosshairHud hud = (CrosshairHud ) HudManager .getInstance ().get (CrosshairHud .ID );
92- if (hud != null && hud .isEnabled ()) {
92+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
9393 if (MinecraftClient .getInstance ().options .debugEnabled && !hud .overridesF3 ()) {
9494 return ;
9595 }
@@ -110,7 +110,7 @@ public abstract class InGameHudMixin {
110110 @ Inject (method = "render" , at = @ At (value = "FIELD" , target = "Lnet/minecraft/client/gui/hud/InGameHud;overlayMessage:Lnet/minecraft/text/Text;" , ordinal = 0 ))
111111 public void axolotlclient$clearActionBar (GuiGraphics graphics , float tickDelta , CallbackInfo ci ) {
112112 ActionBarHud hud = (ActionBarHud ) HudManager .getInstance ().get (ActionBarHud .ID );
113- if (hud != null && hud .isEnabled ()) {
113+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
114114 if (overlayMessage == null || overlayRemaining <= 0 && hud .getActionBar () != null ) {
115115 hud .setActionBar (null , 0 );
116116 }
@@ -120,7 +120,7 @@ public abstract class InGameHudMixin {
120120 @ Redirect (method = "render" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/gui/GuiGraphics;drawShadowedText(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/text/Text;III)I" , ordinal = 0 ))
121121 public int axolotlclient$getActionBar (GuiGraphics instance , TextRenderer renderer , Text text , int x , int y , int color ) {
122122 ActionBarHud hud = (ActionBarHud ) HudManager .getInstance ().get (ActionBarHud .ID );
123- if (hud != null && hud .isEnabled ()) {
123+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
124124 hud .setActionBar (text , color );// give ourselves the correct values
125125 return 0 ; // Doesn't matter since return value is not used
126126 } else {
@@ -131,15 +131,15 @@ public abstract class InGameHudMixin {
131131 @ Inject (method = "renderHotbar" , at = @ At ("HEAD" ), cancellable = true )
132132 public void axolotlclient$customHotbar (float tickDelta , GuiGraphics graphics , CallbackInfo ci ) {
133133 HotbarHUD hud = (HotbarHUD ) HudManager .getInstance ().get (HotbarHUD .ID );
134- if (hud .isEnabled ()) {
134+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
135135 ci .cancel ();
136136 }
137137 }
138138
139139 @ ModifyArgs (method = "renderHeldItemTooltip" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/gui/GuiGraphics;drawShadowedText(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/text/Text;III)I" ))
140140 public void axolotlclient$setItemNamePos (Args args ) {
141141 HotbarHUD hud = (HotbarHUD ) HudManager .getInstance ().get (HotbarHUD .ID );
142- if (hud .isEnabled ()) {
142+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
143143 args .set (2 , hud .getX () + (int ) ((hud .getWidth () * hud .getScale ())
144144 - MinecraftClient .getInstance ().textRenderer .getWidth ((StringVisitable ) args .get (1 ))) / 2 );
145145 args .set (3 , hud .getY () - 36
@@ -150,7 +150,7 @@ public abstract class InGameHudMixin {
150150 @ ModifyArgs (method = "renderMountJumpBar" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/gui/GuiGraphics;drawTexture(Lnet/minecraft/util/Identifier;IIIIII)V" ))
151151 public void axolotlclient$moveHorseHealth (Args args ) {
152152 HotbarHUD hud = (HotbarHUD ) HudManager .getInstance ().get (HotbarHUD .ID );
153- if (hud .isEnabled ()) {
153+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
154154 args .set (1 , hud .getX ());
155155 args .set (2 , hud .getY () - 7 );
156156 }
@@ -159,7 +159,7 @@ public abstract class InGameHudMixin {
159159 @ ModifyArgs (method = "renderExperienceBar" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/gui/GuiGraphics;drawTexture(Lnet/minecraft/util/Identifier;IIIIII)V" ))
160160 public void axolotlclient$moveXPBar (Args args ) {
161161 HotbarHUD hud = (HotbarHUD ) HudManager .getInstance ().get (HotbarHUD .ID );
162- if (hud .isEnabled ()) {
162+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
163163 args .set (1 , hud .getX ());
164164 args .set (2 , hud .getY () - 7 );
165165 }
@@ -168,7 +168,7 @@ public abstract class InGameHudMixin {
168168 @ Redirect (method = "renderExperienceBar" , at = @ At (value = "FIELD" , target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledHeight:I" ))
169169 public int axolotlclient$moveXPBarHeight (InGameHud instance ) {
170170 HotbarHUD hud = (HotbarHUD ) HudManager .getInstance ().get (HotbarHUD .ID );
171- if (hud .isEnabled ()) {
171+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
172172 return hud .getY () + 22 ;
173173 }
174174 return scaledHeight ;
@@ -177,7 +177,7 @@ public abstract class InGameHudMixin {
177177 @ Redirect (method = "renderExperienceBar" , at = @ At (value = "FIELD" , target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledWidth:I" ))
178178 public int axolotlclient$moveXPBarWidth (InGameHud instance ) {
179179 HotbarHUD hud = (HotbarHUD ) HudManager .getInstance ().get (HotbarHUD .ID );
180- if (hud .isEnabled ()) {
180+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
181181 return hud .getX () * 2 + hud .getWidth ();
182182 }
183183 return scaledWidth ;
@@ -186,7 +186,7 @@ public abstract class InGameHudMixin {
186186 @ Redirect (method = "renderStatusBars" , at = @ At (value = "FIELD" , target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledHeight:I" ))
187187 public int axolotlclient$moveStatusBarsHeight (InGameHud instance ) {
188188 HotbarHUD hud = (HotbarHUD ) HudManager .getInstance ().get (HotbarHUD .ID );
189- if (hud .isEnabled ()) {
189+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
190190 return hud .getY () + 22 ;
191191 }
192192 return scaledHeight ;
@@ -195,7 +195,7 @@ public abstract class InGameHudMixin {
195195 @ Redirect (method = "renderStatusBars" , at = @ At (value = "FIELD" , target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledWidth:I" ))
196196 public int axolotlclient$moveStatusBarsWidth (InGameHud instance ) {
197197 HotbarHUD hud = (HotbarHUD ) HudManager .getInstance ().get (HotbarHUD .ID );
198- if (hud .isEnabled ()) {
198+ if (HudManager . getInstance (). hudsEnabled () && hud != null && hud .isEnabled ()) {
199199 return hud .getX () * 2 + hud .getWidth ();
200200 }
201201 return scaledWidth ;
0 commit comments