fix: correct PluginMessageEvent source/target in initial connect handler#693
Merged
Merged
Conversation
During the initial server connect, plugin messages received from the client were fired with the source and target swapped (source=server, target=player). The message actually flows client->server and is forwarded to the backend, so the source must be the player and the target the server connection, matching the play-phase handler. Ports PaperMC/Velocity#1811.
Deploying gate-minekube with
|
| Latest commit: |
830b1f1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://447091c0.gate-minekube.pages.dev |
| Branch Preview URL: | https://fix-plugin-message-event-sou.gate-minekube.pages.dev |
This was referenced Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In
initialConnectSessionHandler.handlePluginMessage, plugin messages received from the client during the initial server connect were fired with thePluginMessageEventsource and target swapped:The message actually flows client → server (it is forwarded to the backend via
serverMc.WritePacket), so the source must be the player and the target the server connection — exactly as the play-phase handler (session_client_play.go) already does it.This means plugin listeners observing
PluginMessageEventduring the initial connect phase now see correctSource()/Target()values, consistent with every other phase.Upstream
Ports PaperMC/Velocity#1811 ("Fix inverted PluginMessageEvent source/target in InitialConnectSessionHandler").
Testing
go build ./pkg/edition/java/proxy/— okgo vet ./pkg/edition/java/proxy/— cleango test ./pkg/edition/java/proxy/— pass