diff options
| author | Aizistral | 2022-07-22 15:37:23 +0200 |
|---|---|---|
| committer | Aizistral | 2022-07-22 15:38:36 +0200 |
| commit | a5927151640430eb256b6aadafe5370989b143d2 (patch) | |
| tree | 741dfc90bb0c1308807bddf171878a76c90df6cc /src/main/java/com/aizistral/nochatreports | |
| parent | f9e35b7805e7d84d1eeb73881a1247a8cde1ed32 (diff) | |
Prevent client disconnection on broken chain
Diffstat (limited to 'src/main/java/com/aizistral/nochatreports')
| -rw-r--r-- | src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java | 13 |
1 files changed, 13 insertions, 0 deletions
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 fb8b726..47e16bf 100644 --- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java +++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java @@ -7,6 +7,7 @@ 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.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.aizistral.nochatreports.NoChatReports; @@ -46,4 +47,16 @@ public class MixinChatListener { } } + /** + * @reason Prevent client from disconnecting when chat chain is broken. + * Normal average user will not even understand what happened, so this is absolutely + * useless for them. + * @author Aizistral + */ + + @Inject(method = "onChatChainBroken", at = @At("HEAD"), cancellable = true) + private void stopUselessDisconnects(CallbackInfo info) { + info.cancel(); + } + } |
