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

Commit 899c2f7

Browse files
committed
fix a few more bugs
1 parent d21287f commit 899c2f7

File tree

15 files changed

+37
-21
lines changed

15 files changed

+37
-21
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.INIT.register((clientPlayNetworkHandler, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
54+
ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, sender, 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/modules/hud/gui/hud/vanilla/HotbarHUD.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class HotbarHUD extends TextHudEntry {
5252

5353
public HotbarHUD() {
5454
super(182, 22, false);
55+
supportsScaling = false;
5556
}
5657

5758
@Override

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.INIT.register((clientPlayNetworkHandler, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
55+
ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, sender, 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/modules/hud/HudEditScreen.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,20 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
125125
if (entry.isPresent()) {
126126
var bounds = entry.get().getTrueBounds();
127127
if (mode == ModificationMode.NONE && bounds.isMouseOver(mouseX, mouseY)) {
128+
var supportsScaling = entry.get().supportsScaling();
128129
var xBound = Math.max(0, mouseX - bounds.x());
129130
var yBound = Math.max(0, mouseY - bounds.y());
130131
var tolerance = GRAB_TOLERANCE;
131-
if (xBound < tolerance && yBound < tolerance) {
132+
if (supportsScaling && xBound < tolerance && yBound < tolerance) {
132133
// top-left
133134
setCursor(NWSE_RESIZE_CURSOR);
134-
} else if (Math.abs(xBound - bounds.width()) < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
135+
} else if (supportsScaling && Math.abs(xBound - bounds.width()) < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
135136
// bottom-right
136137
setCursor(NWSE_RESIZE_CURSOR);
137-
} else if (xBound < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
138+
} else if (supportsScaling && xBound < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
138139
// bottom-left
139140
setCursor(NESW_RESIZE_CURSOR);
140-
} else if (yBound < tolerance && Math.abs(xBound - bounds.width()) < tolerance) {
141+
} else if (supportsScaling && yBound < tolerance && Math.abs(xBound - bounds.width()) < tolerance) {
141142
// top-right
142143
setCursor(NESW_RESIZE_CURSOR);
143144
} else {

1.20/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/HotbarHUD.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class HotbarHUD extends TextHudEntry {
4949

5050
public HotbarHUD() {
5151
super(182, 22, false);
52+
supportsScaling = false;
5253
}
5354

5455
@Override

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.INIT.register((clientPlayNetworkHandler, minecraftClient) -> Events.CONNECTION_PLAY_READY.invoker().run());
55+
ClientPlayConnectionEvents.JOIN.register((clientPlayNetworkHandler, sender, 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/src/main/java/io/github/axolotlclient/mixin/InGameHudMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private void onHudRender(GuiGraphics graphics, DeltaTracker tracker, CallbackInf
135135
public void axolotlclient$customHotbar(GuiGraphics graphics, DeltaTracker tracker, Operation<Void> original) {
136136
HotbarHUD hud = (HotbarHUD) HudManager.getInstance().get(HotbarHUD.ID);
137137
graphics.getMatrices().push();
138-
if (hud.isEnabled()) {
138+
if (hud.isEnabled() && !hud.isHidden()) {
139139
graphics.getMatrices().translate(-graphics.getScaledWindowWidth() / 2f + 182 / 2f, -graphics.getScaledWindowHeight() + 22, 0);
140140
graphics.getMatrices().translate(hud.getX(), hud.getY(), 0);
141141
}

1.21/src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,20 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
124124
if (entry.isPresent()) {
125125
var bounds = entry.get().getTrueBounds();
126126
if (mode == ModificationMode.NONE && bounds.isMouseOver(mouseX, mouseY)) {
127+
var supportsScaling = entry.get().supportsScaling();
127128
var xBound = Math.max(0, mouseX - bounds.x());
128129
var yBound = Math.max(0, mouseY - bounds.y());
129130
var tolerance = GRAB_TOLERANCE;
130-
if (xBound < tolerance && yBound < tolerance) {
131+
if (supportsScaling && xBound < tolerance && yBound < tolerance) {
131132
// top-left
132133
setCursor(NWSE_RESIZE_CURSOR);
133-
} else if (Math.abs(xBound - bounds.width()) < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
134+
} else if (supportsScaling && Math.abs(xBound - bounds.width()) < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
134135
// bottom-right
135136
setCursor(NWSE_RESIZE_CURSOR);
136-
} else if (xBound < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
137+
} else if (supportsScaling && xBound < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
137138
// bottom-left
138139
setCursor(NESW_RESIZE_CURSOR);
139-
} else if (yBound < tolerance && Math.abs(xBound - bounds.width()) < tolerance) {
140+
} else if (supportsScaling && yBound < tolerance && Math.abs(xBound - bounds.width()) < tolerance) {
140141
// top-right
141142
setCursor(NESW_RESIZE_CURSOR);
142143
} else {

1.21/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/HotbarHUD.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class HotbarHUD extends TextHudEntry {
4040

4141
public HotbarHUD() {
4242
super(182, 22, false);
43+
supportsScaling = false;
4344
}
4445

4546
@Override

1.8.9/src/main/java/io/github/axolotlclient/modules/hud/HudEditScreen.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,20 @@ public void render(int mouseX, int mouseY, float delta) {
133133
if (entry.isPresent()) {
134134
var bounds = entry.get().getTrueBounds();
135135
if (mode == ModificationMode.NONE && bounds.isMouseOver(mouseX, mouseY)) {
136+
var supportsScaling = entry.get().supportsScaling();
136137
var xBound = Math.max(0, mouseX - bounds.x());
137138
var yBound = Math.max(0, mouseY - bounds.y());
138139
var tolerance = GRAB_TOLERANCE;
139-
if (xBound < tolerance && yBound < tolerance) {
140+
if (supportsScaling && xBound < tolerance && yBound < tolerance) {
140141
// top-left
141142
setCursor(NWSE_RESIZE_CURSOR);
142-
} else if (Math.abs(xBound - bounds.width()) < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
143+
} else if (supportsScaling && Math.abs(xBound - bounds.width()) < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
143144
// bottom-right
144145
setCursor(NWSE_RESIZE_CURSOR);
145-
} else if (xBound < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
146+
} else if (supportsScaling && xBound < tolerance && Math.abs(yBound - bounds.height()) < tolerance) {
146147
// bottom-left
147148
setCursor(NESW_RESIZE_CURSOR);
148-
} else if (yBound < tolerance && Math.abs(xBound - bounds.width()) < tolerance) {
149+
} else if (supportsScaling && yBound < tolerance && Math.abs(xBound - bounds.width()) < tolerance) {
149150
// top-right
150151
setCursor(NESW_RESIZE_CURSOR);
151152
} else {

0 commit comments

Comments
 (0)