aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_ChatTabs.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_ChatTabs.java')
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_ChatTabs.java12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_ChatTabs.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_ChatTabs.java
index 1d29941..d21097d 100644
--- a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_ChatTabs.java
+++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_ChatTabs.java
@@ -1,13 +1,11 @@
package cc.woverflow.chatting.mixin;
-import cc.woverflow.chatting.chat.ChatSearchingManager;
import cc.woverflow.chatting.chat.ChatTabs;
import cc.woverflow.chatting.config.ChattingConfig;
import cc.woverflow.chatting.utils.ModCompatHooks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ChatLine;
import net.minecraft.client.gui.GuiNewChat;
-import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@@ -17,24 +15,18 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
-import java.util.Locale;
-@Mixin(GuiNewChat.class)
+@Mixin(value = GuiNewChat.class, priority = 990)
public abstract class GuiNewChatMixin_ChatTabs {
@Shadow @Final private Minecraft mc;
@Shadow public abstract void deleteChatLine(int id);
@Shadow @Final private List<ChatLine> chatLines;
- @SuppressWarnings({"FieldCanBeLocal", "unused"})
- private float percentComplete; //betterchat support
@Inject(method = "printChatMessageWithOptionalDeletion", at = @At("HEAD"), cancellable = true)
private void handlePrintChatMessage(IChatComponent chatComponent, int chatLineId, CallbackInfo ci) {
handleChatTabMessage(chatComponent, chatLineId, mc.ingameGUI.getUpdateCounter(), false, ci);
- if (!EnumChatFormatting.getTextWithoutFormattingCodes(chatComponent.getUnformattedText()).toLowerCase(Locale.ENGLISH).contains(ChatSearchingManager.INSTANCE.getLastSearch().toLowerCase(Locale.ENGLISH))) {
- percentComplete = 1.0F;
- }
}
@Inject(method = "setChatLine", at = @At("HEAD"), cancellable = true)
@@ -45,7 +37,7 @@ public abstract class GuiNewChatMixin_ChatTabs {
private void handleChatTabMessage(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) {
if (ChattingConfig.INSTANCE.getChatTabs()) {
if (!ChatTabs.INSTANCE.shouldRender(chatComponent)) {
- percentComplete = 1.0F;
+ ChatTabs.INSTANCE.setHasCancelledAnimation(true);
if (chatLineId != 0) {
deleteChatLine(chatLineId);
}