Skip to content

Commit 88b320f

Browse files
committed
don't tick hud elements twice.
1 parent 806081b commit 88b320f

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ if (System.getProperty("os.name").toLowerCase().contains("mac")) {
8585
configurations.all {
8686
resolutionStrategy {
8787
dependencySubstitution {
88-
substitute module('io.netty:netty-all:4.0.23.Final') using module('io.netty:netty-all:4.0.25.Final')
88+
substitute module('io.netty:netty-all:4.0.23.Final') using module('io.netty:netty-all:4.0.26.Final')
8989
}
90-
force 'io.netty:netty-all:4.0.25.Final'
90+
force 'io.netty:netty-all:4.0.26.Final'
9191
}
9292
}
9393

src/main/java/io/github/axolotlclient/mixin/MinecraftClientMixin.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import io.github.axolotlclient.AxolotlClient;
44
import io.github.axolotlclient.NetworkHelper;
5+
import io.github.axolotlclient.modules.hud.HudManager;
56
import io.github.axolotlclient.modules.rpc.DiscordRPC;
67
import io.github.axolotlclient.modules.zoom.Zoom;
78
import io.github.axolotlclient.util.Hooks;
@@ -89,6 +90,11 @@ public BufferBuilder loadingScreenBg(BufferBuilder instance, int red, int green,
8990
AxolotlClient.CONFIG.loadingScreenColor.get().getBlue(), AxolotlClient.CONFIG.loadingScreenColor.get().getAlpha());
9091
}
9192

93+
@Inject(method = "initializeGame", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/TextureManager;close(Lnet/minecraft/util/Identifier;)V"))
94+
private void onLaunch(CallbackInfo ci){
95+
HudManager.getInstance().refreshAllBounds();
96+
}
97+
9298
@Redirect(
9399
method = "<init>", at = @At(value = "FIELD", target = "Lnet/minecraft/client/RunArgs$Game;version:Ljava/lang/String;"))
94100
private String redirectVersion(RunArgs.Game game) {

src/main/java/io/github/axolotlclient/mixin/TitleScreenMixin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public abstract class TitleScreenMixin extends Screen {
2121

2222
@Inject(method = "initWidgetsNormal", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/ButtonWidget;<init>(IIILjava/lang/String;)V", ordinal = 2), cancellable = true)
2323
public void customTextures(int y, int spacingY, CallbackInfo ci){
24-
HudManager.getInstance().refreshAllBounds();
2524
this.buttons.add(new ButtonWidget(192, this.width / 2 - 100, y + spacingY * 2, 200, 20, I18n.translate("axolotlclient.config")+"..."));
2625
ci.cancel();
2726
}

src/main/java/io/github/axolotlclient/modules/hud/HudManager.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ public static HudManager getInstance() {
4242

4343
private HudManager() {
4444
this.entries = new LinkedHashMap<>();
45-
ClientTickEvents.END_CLIENT_TICK.register(minecraftClient -> {
46-
for (HudEntry entry : getEntries()) {
47-
if (entry.tickable() && entry.isEnabled()) {
48-
entry.tick();
49-
}
50-
}
51-
});
5245
}
5346

5447
static KeyBinding key = new KeyBinding("key.openHud", Keyboard.KEY_RSHIFT, "axolotlclient.category.axolotlclient");

src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/PingHud.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private void updatePing(){
7474
private int second;
7575
@Override
7676
public void tick() {
77-
if(second>=refreshDelay.get()*40){
77+
if(second>=refreshDelay.get()*20){
7878
updatePing();
7979
second=0;
8080
} else second++;

0 commit comments

Comments
 (0)