Add 26.3-pre-2 protocol support - #876
Open
electronicboy wants to merge 1 commit into
Open
Conversation
Adds MINECRAFT_26_3 behind the existing net.md_5.bungee.protocol.snapshot flag, using the snapshot protocol number (0x40000000 | 334) as upstream does during a pre-release cycle, and remaps the packets whose ids moved. 26.3-pre-2 inserts post_effects into both the configuration and game clientbound tables, and swing_animation into the game clientbound table, shifting everything after them: 7 configuration and 19 game packets we register. Serverbound is unaffected for us, as the punch/swing shuffle sits in the 0x2E-0x3F window we do not register in, and CustomClickAction at 0x44 is above it. Every id was checked against the registration order in GameProtocols and ConfigurationProtocols rather than the protocol summary. CommonPlayerSpawnInfo, which Login and Respawn both embed, is the one packet payload change. gameType moved from a byte to a var int, and previousGameType from a byte with a -1 sentinel to vanilla's OPTIONAL_VAR_INT, where zero means absent and any other value is the id plus one. Both fields are only ever round-tripped by the proxy, so no call site needs to change. Everything else we parse is a FriendlyByteBuf to StreamCodec refactor that leaves the wire format identical, including PlayerListItemUpdate, whose new Action id is enum-internal and not serialised. The command argument type registry also grew: context_float_provider, context_int_provider and slot_source after loot_modifier, then feature and swing_animation after dialog, taking it from 57 to 62 entries and shifting dialog and uuid. All five are singleton argument types with no payload, so IDS_26_3 adds them as VOID. Without this, decoding Commands from a 26.3 backend throws ArrayIndexOutOfBoundsException. 26.3 likewise adds a post_effects suggestion provider; those are keyed by name rather than index and unknown names are rejected outright, so it is registered as a dummy for every version. This is temporary and should be dropped once upstream adds 26.3 support.
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.
Adds 26.3-pre-2 support behind the existing
net.md_5.bungee.protocol.snapshotflag, as a single temporary patch to be dropped once upstream lands its own 26.3 support.MINECRAFT_26_3holds the snapshot protocol number (0x40000000 | 334), matching what upstream does during a pre-release cycle before flipping it to the release number.Packet id remaps
26.3-pre-2 inserts
post_effectsinto both the configuration and game clientbound tables, andswing_animationinto the game clientbound table, shifting everything after them. That is 7 configuration and 19 game clientbound packets we register.Serverbound is unaffected for us: the
punch/swingshuffle sits in the0x2E-0x3Fwindow we do not register in, andCustomClickActionat0x44is above it.Every id — including the ones deliberately left alone, such as
KeepAlive0x2C,Login0x31andPlayerListItemRemove/Update0x45/0x46— was derived from the registration order inGameProtocolsandConfigurationProtocolsrather than from a protocol summary, and the resulting table sizes (143 game clientbound, 69 game serverbound, 21 configuration clientbound, 10 configuration serverbound) match the release.CommonPlayerSpawnInfoThe one packet payload change, affecting both
LoginandRespawn, which embed it:gameType: byte -> var intpreviousGameType: byte with a-1sentinel -> vanilla'sOPTIONAL_VAR_INT, where zero means absent and any other value is the id plus oneBoth fields are only ever round-tripped by the proxy, never synthesised, so no call site needed to change. This one is easy to miss: a protocol summary renders it as
commonPlayerSpawnInfo: CommonPlayerSpawnInfo [STREAM_CODEC], which looks like a pure refactor.Everything else we parse really is a
FriendlyByteBuftoStreamCodecrefactor with an identical wire format — includingPlayerListItemUpdate, whose newActionid is enum-internal and not serialised, andTeam, whoseCollection<String>toList<String>change is the same length-prefixed string list as before.Command argument types
The argument type registry grew from 57 to 62 entries:
context_float_provider,context_int_providerandslot_sourceafterloot_modifier, thenfeatureandswing_animationafterdialog, which also shiftsdialoganduuid. All five are singleton argument types with no payload, soIDS_26_3adds them asVOID.Without this, decoding
Commandsfrom a 26.3 backend throws:26.3 likewise adds a
post_effectssuggestion provider. Those are keyed by name rather than index andSuggestionRegistry.getProviderrejects unknown names outright, so it is registered as a dummy for every version.Testing
Builds and passes the test suite. Tested against a 26.3-pre-2 client and backend: connecting, moving between servers, and the command tree all work.