From 4779b8e0c7c08b2d3ee4a5095e8789e9ce274f01 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:33:29 +0100 Subject: [PATCH 1/3] fixed the wrong wording --- .../chatting/mixin/compat/ChatPeekMixin_SkyHanni.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java b/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java index b5792c8..0241cdf 100644 --- a/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java +++ b/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java @@ -20,9 +20,9 @@ public class ChatPeekMixin_SkyHanni { @Dynamic("SkyHanni") @Inject(method = "peek", at = @At("RETURN"), cancellable = true) private static void cancel(CallbackInfoReturnable cir) { - if (!ChattingConfig.INSTANCE.getChatPeek() && cir.getReturnValue()) { + if (ChattingConfig.INSTANCE.getChatPeek() && cir.getReturnValue()) { if (System.currentTimeMillis() - chatting$lastNotify >= 1000) { - Notifications.INSTANCE.send("Chatting", "SkyHanni's chat peek has been replaced by Chatting. You can configure this via OneConfig, by clicking the right shift key on your keyboard, or by typing /chatting in your chat."); + Notifications.INSTANCE.send("Chatting", "You have activated the “Chat peek” feature in both SkyHanni and Chatting. Deactivate one of the two to avoid unintended behavior."); chatting$lastNotify = System.currentTimeMillis(); } } From 3ed30f013a464cdd40af82c9a50c9d9ee03ac4f0 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 23 Nov 2024 12:04:05 +0100 Subject: [PATCH 2/3] stop disabling other mods features --- .../polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java b/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java index 0241cdf..6496543 100644 --- a/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java +++ b/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java @@ -26,6 +26,5 @@ private static void cancel(CallbackInfoReturnable cir) { chatting$lastNotify = System.currentTimeMillis(); } } - cir.setReturnValue(false); } } \ No newline at end of file From 47cde471ad86347ef283372dde8db89b3a055c0b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 23 Nov 2024 12:23:02 +0100 Subject: [PATCH 3/3] removed ChatPeekMixin_SkyHanni entirely --- .../mixin/compat/ChatPeekMixin_SkyHanni.java | 30 ------------------- src/main/resources/mixins.chatting.json | 1 - 2 files changed, 31 deletions(-) delete mode 100644 src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java diff --git a/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java b/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java deleted file mode 100644 index 6496543..0000000 --- a/src/main/java/org/polyfrost/chatting/mixin/compat/ChatPeekMixin_SkyHanni.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.polyfrost.chatting.mixin.compat; - -import cc.polyfrost.oneconfig.utils.Notifications; -import org.polyfrost.chatting.config.ChattingConfig; -import org.spongepowered.asm.mixin.Dynamic; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Pseudo; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -@Pseudo -@Mixin(targets = {"at.hannibal2.skyhanni.features.chat.ChatPeek"}) -public class ChatPeekMixin_SkyHanni { - - @Unique - private static long chatting$lastNotify = System.currentTimeMillis(); - - @Dynamic("SkyHanni") - @Inject(method = "peek", at = @At("RETURN"), cancellable = true) - private static void cancel(CallbackInfoReturnable cir) { - if (ChattingConfig.INSTANCE.getChatPeek() && cir.getReturnValue()) { - if (System.currentTimeMillis() - chatting$lastNotify >= 1000) { - Notifications.INSTANCE.send("Chatting", "You have activated the “Chat peek” feature in both SkyHanni and Chatting. Deactivate one of the two to avoid unintended behavior."); - chatting$lastNotify = System.currentTimeMillis(); - } - } - } -} \ No newline at end of file diff --git a/src/main/resources/mixins.chatting.json b/src/main/resources/mixins.chatting.json index 2bdc703..057ecf4 100644 --- a/src/main/resources/mixins.chatting.json +++ b/src/main/resources/mixins.chatting.json @@ -29,7 +29,6 @@ "GuiUtilsMixin", "HUDUtilsMixin", "InventoryPlayerMixin", - "compat.ChatPeekMixin_SkyHanni", "compat.ChatTabsMixin_SkytilsCopyChat", "compat.EssentialKeybindingRegistryMixin" ]