summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/aizistral
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/aizistral')
-rw-r--r--src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java4
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java12
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java3
3 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java b/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java
index 8f46afa..912898e 100644
--- a/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java
+++ b/src/main/java/com/aizistral/nochatreports/core/NoReportsConfig.java
@@ -40,9 +40,9 @@ public class NoReportsConfig {
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
private static NoReportsConfig INSTANCE;
private boolean demandOnClient = true, demandOnServer = false, enableDebugLog = false,
- convertToGameMessage = false, showServerSafety = true, hideYellowChatIndicators = true,
+ convertToGameMessage = false, showServerSafety = true, hideRedChatIndicators = true,
- hideRedChatIndicators = true, hideGrayChatIndicators = true, hideWarningToast = true,
+ hideYellowChatIndicators = true, hideGrayChatIndicators = true, hideWarningToast = true,
alwaysHideReportButton = false, versionEasterEgg = true, disableTelemetry = true,
showReloadButton = true;
private List<String> whitelistedServers;
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java
index d3f0494..9ac04fc 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java
@@ -5,6 +5,8 @@ import java.util.Base64;
import java.util.UUID;
import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Shadow;
+import org.spongepowered.asm.mixin.gen.Invoker;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -22,14 +24,14 @@ import net.minecraft.network.chat.PlayerChatMessage;
@Mixin(ChatListener.class)
public class MixinChatListener {
- @Inject(method = "isSenderLocalPlayer", at = @At("RETURN"))
- private boolean isSenderLocalPlayer(UUID uuid, CallbackInfoReturnable<Boolean> cir) {
- return cir.getReturnValue();
+ @Shadow
+ private boolean isSenderLocalPlayer(UUID uuid) {
+ return false;
}
/**
* @reason Removes "Not Secure" and "Modified" statuses of chat messages. They ultimately
- * server no purpose but to annoy the user and scare them away from servers that actually
+ * serve no purpose but to annoy the user and scare them away from servers that actually
* try to protect them by stripping message signatures.
* @author Aizistral
*/
@@ -38,7 +40,7 @@ public class MixinChatListener {
private void onEvaluateTrustLevel(PlayerChatMessage playerChatMessage,
Component component, PlayerInfo playerInfo, Instant instant, CallbackInfoReturnable<ChatTrustLevel> info) {
- if (this.isSenderLocalPlayer(playerChatMessage.signer().profileId(), null)){
+ if (isSenderLocalPlayer(playerChatMessage.signer().profileId())){
info.setReturnValue(ChatTrustLevel.SECURE);
}
else {
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java
index b65706c..1d5e060 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTag.java
@@ -1,5 +1,6 @@
package com.aizistral.nochatreports.mixins.client;
+import net.minecraft.network.chat.Component;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@@ -22,7 +23,7 @@ public class MixinGuiMessageTag {
@Inject(method = "system", at = @At("HEAD"), cancellable = true)
private static void onSystem(CallbackInfoReturnable<GuiMessageTag> info) {
if (NoReportsConfig.hideGrayChatIndicators()) {
- info.setReturnValue(null);
+ info.setReturnValue(new GuiMessageTag(0, null, null, "System"));
}
}