diff options
| author | Aizistral | 2022-07-01 08:33:16 +0200 |
|---|---|---|
| committer | Aizistral | 2022-07-01 08:33:16 +0200 |
| commit | ee2d1a67faf64832181df4ed1bd320d5371d7986 (patch) | |
| tree | e70ae4f7314c2d14fc77865f106253a67a47597e /src/main/java/com/aizistral/nochatreports | |
| parent | e0b1be6d8e2e5348a778231162fad213ee85d1ac (diff) | |
Remove chat safety notices
Fixes #31
Diffstat (limited to 'src/main/java/com/aizistral/nochatreports')
| -rw-r--r-- | src/main/java/com/aizistral/nochatreports/mixins/MixinChatListener.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/MixinChatListener.java b/src/main/java/com/aizistral/nochatreports/mixins/MixinChatListener.java new file mode 100644 index 0000000..768c873 --- /dev/null +++ b/src/main/java/com/aizistral/nochatreports/mixins/MixinChatListener.java @@ -0,0 +1,32 @@ +package com.aizistral.nochatreports.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.aizistral.nochatreports.handlers.NoReportsConfig; + +import net.minecraft.client.multiplayer.PlayerInfo; +import net.minecraft.client.multiplayer.chat.ChatListener; +import net.minecraft.client.multiplayer.chat.ChatTrustLevel; +import net.minecraft.network.chat.ChatSender; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.PlayerChatMessage; + +@Mixin(ChatListener.class) +public class MixinChatListener { + + /** + * @reason No annoying safety notices, thanks. Your system is unsafe anyways. + * @author Aizistral + */ + + @Inject(method = "evaluateTrustLevel", at = @At("HEAD"), cancellable = true) + private void onEvaluateTrustLevel(ChatSender chatSender, PlayerChatMessage playerChatMessage, + Component component, PlayerInfo playerInfo, CallbackInfoReturnable<ChatTrustLevel> info) { + info.setReturnValue(ChatTrustLevel.SECURE); + } + +} |
