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

Commit be283ad

Browse files
committed
(1.8.9) fix flashy chat animation
1 parent b2092e3 commit be283ad

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

1.8.9/src/main/java/io/github/axolotlclient/mixin/ChatHudMixin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public abstract class ChatHudMixin {
7676

7777
@ModifyArg(method = "addMessage(Lnet/minecraft/text/Text;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/chat/ChatGui;addMessage(Lnet/minecraft/text/Text;IIZ)V"))
7878
public Text axolotlclient$editChat(Text message) {
79+
io.github.axolotlclient.modules.hud.gui.hud.ChatHud hud = (io.github.axolotlclient.modules.hud.gui.hud.ChatHud) HudManager
80+
.getInstance().get(io.github.axolotlclient.modules.hud.gui.hud.ChatHud.ID);
81+
if (hud.isEnabled()) {
82+
hud.resetAnimation();
83+
}
7984
return NickHider.getInstance().editMessage(message);
8085
}
8186

1.8.9/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/ChatHud.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import io.github.axolotlclient.modules.hud.gui.entry.TextHudEntry;
3535
import io.github.axolotlclient.modules.hud.util.DrawPosition;
3636
import io.github.axolotlclient.modules.hud.util.DrawUtil;
37-
import io.github.axolotlclient.util.events.Events;
3837
import net.minecraft.client.Minecraft;
3938
import net.minecraft.client.gui.chat.ChatMessage;
4039
import net.minecraft.client.gui.screen.ChatScreen;
@@ -74,7 +73,6 @@ private void updatePercentage(long diff) {
7473

7574
public ChatHud() {
7675
super(320, 80, false);
77-
Events.RECEIVE_CHAT_MESSAGE_EVENT.register(e -> percentComplete = 0);
7876
}
7977

8078
public static int getHeight(float chatHeight) {
@@ -83,6 +81,10 @@ public static int getHeight(float chatHeight) {
8381
return MathHelper.floor(chatHeight * (float) (i - j) + (float) j);
8482
}
8583

84+
public void resetAnimation() {
85+
percentComplete = 0;
86+
}
87+
8688
@Override
8789
public void render(float delta) {
8890
long current = System.currentTimeMillis();
@@ -118,7 +120,7 @@ public void render(float delta) {
118120
if (n < 200 || isChatFocused()) {
119121
double d = MathHelper.clamp((1.0 - n / 200.0) * 10.0, 0.0, 1.0);
120122
d *= d;
121-
if (m+scrolledLines < newLines) {
123+
if (animateChat.get() && m+scrolledLines < newLines) {
122124
d *= animationPercent;
123125
}
124126
int Opacity = isChatFocused() ? 255 : (int) (255.0 * d);

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ org.gradle.parallel=true
66
axolotlclient.modules.all=true
77

88
# Mod Properties
9-
version=3.1.1-rc.4
9+
version=3.1.1-rc.5
1010

1111
maven_group=io.github.axolotlclient
1212

@@ -31,6 +31,6 @@ fapi_121=0.107.0
3131
fabric_cts8=0.42.0+1.16
3232
osl=0.16.1
3333

34-
legacy_lwgjl3=1.2.2+1.8.9
34+
legacy_lwgjl3=1.2.3+1.8.9
3535

3636
config=3.0.3

0 commit comments

Comments
 (0)