aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-02-06 10:39:36 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-02-06 10:39:36 +0700
commit6ef0b0b64522ae45bf3747b26bd6dc5f58358f82 (patch)
tree267709bb401f10f414534552a39a7697614aa4f9 /src/main/java
parent1307b6c8f8f7a4aa4d1fd9781cddb5edd0c9f349 (diff)
downloadChatting-6ef0b0b64522ae45bf3747b26bd6dc5f58358f82.tar.gz
Chatting-6ef0b0b64522ae45bf3747b26bd6dc5f58358f82.tar.bz2
Chatting-6ef0b0b64522ae45bf3747b26bd6dc5f58358f82.zip
1.3.0
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/RedactionNameHighlightMixin.java22
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/WyvtilsListenerMixin.java2
2 files changed, 23 insertions, 1 deletions
diff --git a/src/main/java/cc/woverflow/chatting/mixin/RedactionNameHighlightMixin.java b/src/main/java/cc/woverflow/chatting/mixin/RedactionNameHighlightMixin.java
new file mode 100644
index 0000000..eab1bfe
--- /dev/null
+++ b/src/main/java/cc/woverflow/chatting/mixin/RedactionNameHighlightMixin.java
@@ -0,0 +1,22 @@
+package cc.woverflow.chatting.mixin;
+
+import cc.woverflow.chatting.utils.RenderUtils;
+import org.spongepowered.asm.mixin.Dynamic;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Pseudo;
+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 = "net.wyvest.redaction.features.NameHighlight")
+public class RedactionNameHighlightMixin {
+
+ @Dynamic("REDACTION")
+ @Inject(method = "highlightName", at = @At("HEAD"), cancellable = true)
+ private static void onNameHighlight(String text, CallbackInfoReturnable<String> cir) {
+ if (RenderUtils.getBypassNameHighlight()) {
+ cir.setReturnValue(text);
+ }
+ }
+}
diff --git a/src/main/java/cc/woverflow/chatting/mixin/WyvtilsListenerMixin.java b/src/main/java/cc/woverflow/chatting/mixin/WyvtilsListenerMixin.java
index f5b7cfb..4c7448e 100644
--- a/src/main/java/cc/woverflow/chatting/mixin/WyvtilsListenerMixin.java
+++ b/src/main/java/cc/woverflow/chatting/mixin/WyvtilsListenerMixin.java
@@ -16,6 +16,6 @@ public class WyvtilsListenerMixin {
@Dynamic("Wyvtils")
@Inject(method = "onStringRendered", at = @At("HEAD"), cancellable = true, remap = false)
private void cancelStringRender(@Coerce Object a, CallbackInfo ci) {
- if (RenderUtils.getBypassWyvtils()) ci.cancel();
+ if (RenderUtils.getBypassNameHighlight()) ci.cancel();
}
}