Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 87473a2

Browse files
committed
fix hud rendering side-effects bug
- fix initializing the hypixel mod api too late - fix CoordsHud delimiter/spacing
1 parent 4280286 commit 87473a2

File tree

15 files changed

+80
-69
lines changed

15 files changed

+80
-69
lines changed

1.16_combat-6/src/main/java/io/github/axolotlclient/bridge/impl/Bridge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public Identifier getFabricId() {
5151
return new Identifier("axolotlclient", "bridge/resource_listener");
5252
}
5353
});
54-
ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, packetSender, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
54+
ClientPlayConnectionEvents.INIT.register((clientPlayNetworkHandler, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
5555
ClientPlayConnectionEvents.DISCONNECT.register((clientPlayNetworkHandler, minecraftClient) -> Events.DISCONNECT.invoker().run());
5656
}
5757

1.16_combat-6/src/main/java/io/github/axolotlclient/mixin/InGameHudMixin.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ public abstract class InGameHudMixin {
8282
@Inject(method = "renderStatusEffectOverlay", at = @At("HEAD"), cancellable = true)
8383
public void axolotlclient$renderStatusEffect(MatrixStack matrices, CallbackInfo ci) {
8484
PotionsHud hud = (PotionsHud) HudManager.getInstance().get(PotionsHud.ID);
85-
if (hud != null && hud.isEnabled()) {
85+
if (HudManager.getInstance().hudsEnabled() && hud != null && hud.isEnabled()) {
8686
ci.cancel();
8787
}
8888
}
8989

9090
@Inject(method = "renderCrosshair", at = @At("HEAD"), cancellable = true)
9191
public void axolotlclient$renderCrosshair(MatrixStack matrices, CallbackInfo ci) {
9292
CrosshairHud hud = (CrosshairHud) HudManager.getInstance().get(CrosshairHud.ID);
93-
if (hud != null && hud.isEnabled()) {
93+
if (HudManager.getInstance().hudsEnabled() && hud != null && hud.isEnabled()) {
9494
if (MinecraftClient.getInstance().options.debugEnabled && !hud.overridesF3()) {
9595
return;
9696
}
@@ -111,7 +111,7 @@ public abstract class InGameHudMixin {
111111
@Inject(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;overlayMessage:Lnet/minecraft/text/Text;", ordinal = 0))
112112
public void axolotlclient$clearActionBar(MatrixStack matrices, float tickDelta, CallbackInfo ci) {
113113
ActionBarHud hud = (ActionBarHud) HudManager.getInstance().get(ActionBarHud.ID);
114-
if (hud != null && hud.isEnabled()) {
114+
if (HudManager.getInstance().hudsEnabled() && hud != null && hud.isEnabled()) {
115115
if (overlayMessage == null || overlayRemaining <= 0 && hud.getActionBar() != null) {
116116
hud.setActionBar(null, 0);
117117
}
@@ -121,7 +121,7 @@ public abstract class InGameHudMixin {
121121
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;drawWithShadow(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/text/Text;FFI)I", ordinal = 0))
122122
public int axolotlclient$getActionBar(TextRenderer instance, MatrixStack matrices, Text message, float x, float y, int color) {
123123
ActionBarHud hud = (ActionBarHud) HudManager.getInstance().get(ActionBarHud.ID);
124-
if (hud != null && hud.isEnabled()) {
124+
if (HudManager.getInstance().hudsEnabled() && hud != null && hud.isEnabled()) {
125125
hud.setActionBar(message, color);// give ourselves the correct values
126126
return 0; // Doesn't matter since return value is not used
127127
} else {
@@ -132,15 +132,15 @@ public abstract class InGameHudMixin {
132132
@Inject(method = "renderHotbar", at = @At("HEAD"), cancellable = true)
133133
public void axolotlclient$customHotbar(float tickDelta, MatrixStack matrices, CallbackInfo ci) {
134134
HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID);
135-
if (hud.isEnabled()) {
135+
if (HudManager.getInstance().hudsEnabled() && hud.isEnabled()) {
136136
ci.cancel();
137137
}
138138
}
139139

140140
@ModifyArgs(method = "renderHeldItemTooltip", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;drawWithShadow(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/text/Text;FFI)I"))
141141
public void axolotlclient$setItemNamePos(Args args) {
142142
HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID);
143-
if (hud.isEnabled()) {
143+
if (HudManager.getInstance().hudsEnabled() && hud.isEnabled()) {
144144
args.set(2, ((Integer) hud.getX()).floatValue() + ((hud.getWidth() * hud.getScale())
145145
- MinecraftClient.getInstance().textRenderer.getWidth((StringVisitable) args.get(1))) / 2);
146146
args.set(3, ((Integer) hud.getY()).floatValue() - 36
@@ -151,7 +151,7 @@ public abstract class InGameHudMixin {
151151
@ModifyArgs(method = "renderMountJumpBar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;drawTexture(Lnet/minecraft/client/util/math/MatrixStack;IIIIII)V"))
152152
public void axolotlclient$moveHorseHealth(Args args) {
153153
HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID);
154-
if (hud.isEnabled()) {
154+
if (HudManager.getInstance().hudsEnabled() && hud.isEnabled()) {
155155
args.set(1, hud.getX());
156156
args.set(2, hud.getY() - 7);
157157
}
@@ -160,7 +160,7 @@ public abstract class InGameHudMixin {
160160
@ModifyArgs(method = "renderExperienceBar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;drawTexture(Lnet/minecraft/client/util/math/MatrixStack;IIIIII)V"))
161161
public void axolotlclient$moveXPBar(Args args) {
162162
HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID);
163-
if (hud.isEnabled()) {
163+
if (HudManager.getInstance().hudsEnabled() && hud.isEnabled()) {
164164
args.set(1, hud.getX());
165165
args.set(2, hud.getY() - 7);
166166
}
@@ -169,7 +169,7 @@ public abstract class InGameHudMixin {
169169
@Redirect(method = "renderExperienceBar", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledHeight:I"))
170170
public int axolotlclient$moveXPBarHeight(InGameHud instance) {
171171
HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID);
172-
if (hud.isEnabled()) {
172+
if (HudManager.getInstance().hudsEnabled() && hud.isEnabled()) {
173173
return hud.getY() + 22;
174174
}
175175
return scaledHeight;
@@ -178,7 +178,7 @@ public abstract class InGameHudMixin {
178178
@Redirect(method = "renderExperienceBar", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledWidth:I"))
179179
public int axolotlclient$moveXPBarWidth(InGameHud instance) {
180180
HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID);
181-
if (hud.isEnabled()) {
181+
if (HudManager.getInstance().hudsEnabled() && hud.isEnabled()) {
182182
return hud.getX() * 2 + hud.getWidth();
183183
}
184184
return scaledWidth;
@@ -187,7 +187,7 @@ public abstract class InGameHudMixin {
187187
@Redirect(method = "renderStatusBars", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledHeight:I"))
188188
public int axolotlclient$moveStatusBarsHeight(InGameHud instance) {
189189
HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID);
190-
if (hud.isEnabled()) {
190+
if (HudManager.getInstance().hudsEnabled() && hud.isEnabled()) {
191191
return hud.getY() + 22;
192192
}
193193
return scaledHeight;
@@ -196,7 +196,7 @@ public abstract class InGameHudMixin {
196196
@Redirect(method = "renderStatusBars", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/InGameHud;scaledWidth:I"))
197197
public int axolotlclient$moveStatusBarsWidth(InGameHud instance) {
198198
HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID);
199-
if (hud.isEnabled()) {
199+
if (HudManager.getInstance().hudsEnabled() && hud.isEnabled()) {
200200
return hud.getX() * 2 + hud.getWidth();
201201
}
202202
return scaledWidth;

1.20/src/main/java/io/github/axolotlclient/bridge/impl/Bridge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Identifier getFabricId() {
5252
return new Identifier("axolotlclient", "bridge/resource_listener");
5353
}
5454
});
55-
ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, packetSender, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
55+
ClientPlayConnectionEvents.INIT.register((clientPlayNetworkHandler, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
5656
ClientPlayConnectionEvents.DISCONNECT.register((clientPlayNetworkHandler, minecraftClient) -> Events.DISCONNECT.invoker().run());
5757

5858
ClientCommandRegistrationCallback.EVENT.register((commandDispatcher, commandBuildContext) ->

1.20/src/main/java/io/github/axolotlclient/mixin/InGameHudMixin.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

1.21.7/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ val minecraftFriendly = "1.21.8"
1010
val parchmentMinecraft = "1.21.8"
1111
val parchment = "2025.07.18"
1212
val modmenu = "14.0.0-rc.2"
13-
val fapi = "0.132.0"
13+
val fapi = "0.133.0"
1414
group = project.property("maven_group") as String
1515
version = "${project.property("version")}+$minecraftFriendly"
1616
base.archivesName = "AxolotlClient"

1.21.7/src/main/java/io/github/axolotlclient/bridge/impl/Bridge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public ResourceLocation getFabricId() {
5252
return ResourceLocation.fromNamespaceAndPath("axolotlclient", "bridge/resource_listener");
5353
}
5454
});
55-
ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, packetSender, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
55+
ClientPlayConnectionEvents.INIT.register((clientPlayNetworkHandler, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
5656
ClientPlayConnectionEvents.DISCONNECT.register((clientPlayNetworkHandler, minecraftClient) -> Events.DISCONNECT.invoker().run());
5757

5858
ClientCommandRegistrationCallback.EVENT.register((commandDispatcher, commandBuildContext) ->

1.21.7/src/main/java/io/github/axolotlclient/mixin/InGameHudMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ private void onHudRender(GuiGraphics guiGraphics, DeltaTracker deltaTracker, Cal
6666
@Inject(method = "renderEffects", at = @At("HEAD"), cancellable = true)
6767
public void axolotlclient$renderStatusEffect(GuiGraphics graphics, DeltaTracker tracker, CallbackInfo ci) {
6868
PotionsHud hud = (PotionsHud) HudManager.getInstance().get(PotionsHud.ID);
69-
if (hud != null && hud.isEnabled()) {
69+
if (HudManager.getInstance().hudsEnabled() && hud != null && hud.isEnabled()) {
7070
ci.cancel();
7171
}
7272
}
7373

7474
@Inject(method = "renderCrosshair", at = @At("HEAD"), cancellable = true)
7575
public void axolotlclient$renderCrosshair(GuiGraphics graphics, DeltaTracker tracker, CallbackInfo ci) {
7676
CrosshairHud hud = (CrosshairHud) HudManager.getInstance().get(CrosshairHud.ID);
77-
if (hud != null && hud.isEnabled()) {
77+
if (HudManager.getInstance().hudsEnabled() && hud != null && hud.isEnabled()) {
7878
if (minecraft.gui.getDebugOverlay().showDebugScreen() && !hud.overridesF3()) {
7979
return;
8080
}
@@ -97,7 +97,7 @@ private void onHudRender(GuiGraphics guiGraphics, DeltaTracker deltaTracker, Cal
9797
target = "Lnet/minecraft/client/gui/GuiGraphics;drawStringWithBackdrop(Lnet/minecraft/client/gui/Font;Lnet/minecraft/network/chat/Component;IIII)V"))
9898
public void axolotlclient$getActionBar(GuiGraphics instance, Font font, Component text, int x, int y, int width, int color, Operation<Integer> original) {
9999
ActionBarHud hud = (ActionBarHud) HudManager.getInstance().get(ActionBarHud.ID);
100-
if (hud != null && hud.isEnabled()) {
100+
if (HudManager.getInstance().hudsEnabled() && hud != null && hud.isEnabled()) {
101101
instance.pose().popMatrix();
102102
hud.render(instance, text, color);
103103
instance.pose().pushMatrix();

1.21/src/main/java/io/github/axolotlclient/bridge/impl/Bridge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Identifier getFabricId() {
5252
return Identifier.of("axolotlclient", "bridge/resource_listener");
5353
}
5454
});
55-
ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, packetSender, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
55+
ClientPlayConnectionEvents.INIT.register((clientPlayNetworkHandler, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
5656
ClientPlayConnectionEvents.DISCONNECT.register((clientPlayNetworkHandler, minecraftClient) -> Events.DISCONNECT.invoker().run());
5757

5858
ClientCommandRegistrationCallback.EVENT.register((commandDispatcher, commandBuildContext) ->

0 commit comments

Comments
 (0)