diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2023-01-12 20:17:38 -0500 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2023-01-12 20:17:38 -0500 |
commit | 8e0087172174b2aec0fce9ef4a2f2e287251ff74 (patch) | |
tree | 6a076cff7a48cf8fea31b395c11437f7875cc87f | |
parent | 504f2aaf5c743be9a91615cb2fce9f0a45d11962 (diff) | |
download | Chatting-8e0087172174b2aec0fce9ef4a2f2e287251ff74.tar.gz Chatting-8e0087172174b2aec0fce9ef4a2f2e287251ff74.tar.bz2 Chatting-8e0087172174b2aec0fce9ef4a2f2e287251ff74.zip |
Revert "Allow for custom messages (#14)"
This reverts commit 504f2aaf5c743be9a91615cb2fce9f0a45d11962.
-rw-r--r-- | src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java | 24 | ||||
-rw-r--r-- | src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt | 1 |
2 files changed, 10 insertions, 15 deletions
diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java index d26dc7b..2bc5592 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java +++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java @@ -1,20 +1,25 @@ package cc.woverflow.chatting.mixin; import cc.polyfrost.oneconfig.config.core.OneColor; -import cc.polyfrost.oneconfig.libs.universal.ChatColor; -import cc.polyfrost.oneconfig.libs.universal.UMouse; +import cc.polyfrost.oneconfig.utils.color.ColorUtils; import cc.woverflow.chatting.Chatting; import cc.woverflow.chatting.chat.ChatSearchingManager; import cc.woverflow.chatting.chat.ChatTabs; import cc.woverflow.chatting.config.ChattingConfig; import cc.woverflow.chatting.gui.components.CleanButton; +import cc.woverflow.chatting.hook.ChatLineHook; import cc.woverflow.chatting.hook.GuiNewChatHook; import cc.woverflow.chatting.utils.ModCompatHooks; import cc.woverflow.chatting.utils.RenderUtils; +import cc.polyfrost.oneconfig.libs.universal.UMouse; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.*; +import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.util.*; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -29,7 +34,6 @@ import org.spongepowered.asm.mixin.injection.invoke.arg.Args; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.image.BufferedImage; -import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -71,8 +75,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { @Shadow public abstract void deleteChatLine(int id); - @Shadow - public abstract int getChatWidth(); + @Shadow public abstract int getChatWidth(); @Unique private static final ResourceLocation COPY = new ResourceLocation("chatting:copy.png"); @@ -156,7 +159,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { float f = this.getChatScale(); int left = 0; int top = (int) ((float) args.get(2) - 1); - int right = MathHelper.ceiling_float_int((float) getChatWidth() / f) + 4; + int right = MathHelper.ceiling_float_int((float)getChatWidth() / f) + 4; int bottom = (int) ((float) args.get(2) + 8); if ((chatting$shouldCopy && lineInBounds) || isInBounds(left, top, right, bottom, f)) { chatting$shouldCopy = true; @@ -183,13 +186,6 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { @Redirect(method = "drawChat", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/GuiNewChat;drawnChatLines:Ljava/util/List;", opcode = Opcodes.GETFIELD)) private List<ChatLine> injected(GuiNewChat instance) { - if (!ChatTabs.INSTANCE.getCurrentTab().getMessages().isEmpty()) { - List<ChatLine> list = new ArrayList<>(); - for (String message : ChatTabs.INSTANCE.getCurrentTab().getMessages()) { - list.add(new ChatLine(0, new ChatComponentText(ChatColor.Companion.translateAlternateColorCodes('&', message)), 0)); - } - return ChatSearchingManager.filterMessages(chatting$previousText, list); - } return ChatSearchingManager.filterMessages(chatting$previousText, drawnChatLines); } diff --git a/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt index 75b5d69..50de1f4 100644 --- a/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt +++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt @@ -30,7 +30,6 @@ data class ChatTab( lateinit var button: TabButton lateinit var compiledRegex: ChatRegexes lateinit var compiledIgnoreRegex: ChatRegexes - @Transient var messages: List<String> = ArrayList() //Ugly hack to make GSON not make button / regex null fun initialize() { |