From 1b3670de60500c491e5c61b0d304bcde7e30080f Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sat, 14 Jan 2023 12:13:13 -0500 Subject: various new features - right click to copy chat message - tooltip text render type - delete button for individual chat lines - copying chat messages now always shows a notification output --- src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java') diff --git a/src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java b/src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java index ab052ae..beef37b 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java +++ b/src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java @@ -29,9 +29,13 @@ public class ChatLineMixin implements ChatLineHook { private NetworkPlayerInfo playerInfo; private NetworkPlayerInfo detectedPlayerInfo; private static NetworkPlayerInfo lastPlayerInfo; + private static long lastUniqueId = 0; + private long uniqueId = 0; @Inject(method = "", at = @At("RETURN")) private void onInit(int i, IChatComponent iChatComponent, int j, CallbackInfo ci) { + lastUniqueId++; + uniqueId = lastUniqueId; chatLines.add(new WeakReference<>((ChatLine) (Object) this)); NetHandlerPlayClient netHandler = Minecraft.getMinecraft().getNetHandler(); if (netHandler == null) return; @@ -102,4 +106,9 @@ public class ChatLineMixin implements ChatLineHook { playerInfo = detectedPlayerInfo; } } + + @Override + public long getUniqueId() { + return uniqueId; + } } -- cgit