No Chat Reports

No Chat Reports

43M Downloads

Chat encryption happening too early for client side mods

wagyourtail opened this issue ยท 3 comments

commented

Modloader

Fabric

Minecraft Version

1.19.4

Modloader Version

No Chat Reports Version

1.19.4-v2.1.1

Modpack Info

No response

The latest.log File

N/A

Bug Description

NCR encrypts messages too early in the process for most client-side mods to handle properly.

This is fixable by injecting into the chat message s2c/c2s packets initializers and doing the encryption there instead

Steps to Reproduce

  1. enable encryption
  2. have baritone
  3. try to use baritone

Other Information

cabaletta/baritone#3894

looks like meteor also injects at the same spot https://github.com/MeteorDevelopment/meteor-client/blob/03d17cd4a6d5f8102cdbe2c5f2ed9cebc8b80b10/src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayNetworkHandlerMixin.java#L130

also some mods such as jsmacros will end up bypassing the encryption by sending at that lower level;
https://github.com/JsMacros/JsMacros/blob/274c80c0d817276733a3d05ef20a477ec228f2af/common/src/main/java/xyz/wagyourtail/jsmacros/client/api/library/impl/FChat.java#L154

I'm sure there are many other mods like this

I suggest moving the encryption/decryption to happen when the packet classes are constructed in order to be compatible with most if not all client mods

commented

It would be nice if this issue could be resolved, as having to toggle encryption manually to run Baritone commands is rather tedious.

commented

I have decided against fixing this in 1.19. Changing injection point for encryption can potentially lead to other issues, and since I do not plan to release 1.19 updates after 1.20 is released, I will do this after porting to 1.20, where I will be able to address them as part of ongoing maintenance.

commented

IT ALSO APPEARS ON FORGE 1.20.1 WITH BARITONE MOD!