Skip to content

Refactor ServerLogin encryption injection to use @WrapOperation - #165

Open
XandarNull wants to merge 1 commit into
astei:masterfrom
XandarNull:master
Open

Refactor ServerLogin encryption injection to use @WrapOperation#165
XandarNull wants to merge 1 commit into
astei:masterfrom
XandarNull:master

Conversation

@XandarNull

@XandarNull XandarNull commented Aug 25, 2026

Copy link
Copy Markdown

Hey

This PR refactors ServerLoginPacketListenerImplMixin to replace the old @Redirects with MixinExtras @WrapOperation and a standard cancellable @Inject.

Unlike PR #153 , this doesn't use any isModLoaded hacks or disable native ciphers. Velocity native encryption stays fully active and running as usual on all standard connections, but switching away from @Redirect stops Mixin from crashing when other network mods touch handleKey.

Tested on integrated server and LAN, everything connects, and native ciphers work properly.

Fixes #152

- Replace Redirect on Crypt.getCipher and Connection.setEncryptionKey with WrapOperation
- Capture SecretKey with Local and check for null before setting up native encryption
- Cancel vanilla Cipher setup via Inject in ConnectionMixin when Krypton encryption is enabled
- Add MixinExtras dependency to build.gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mixin conflict with e4mc 6.0.0 and above

1 participant