summaryrefslogtreecommitdiffstats
path: root/src/main/java/com
diff options
context:
space:
mode:
authorMadis2022-07-28 22:43:29 +0300
committerMadis2022-07-29 20:53:42 +0300
commitc6ed7f49f41024cb4e46fea2bc4e9809f2903e18 (patch)
tree1a9ba8e4f2e5d356f2e6d685e054d67bf2ac0b5e /src/main/java/com
parent2098850c64f0d31e3d20b1cc3a8c281435b81519 (diff)
More fixes
Diffstat (limited to 'src/main/java/com')
-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"));
}
}