Skip to content

Add 26.3-pre-3 protocol support - #876

Merged
electronicboy merged 1 commit into
masterfrom
waterfall-spec-26-2-26-3
Sep 7, 2026
Merged

Add 26.3-pre-3 protocol support#876
electronicboy merged 1 commit into
masterfrom
waterfall-spec-26-2-26-3

Conversation

@electronicboy

@electronicboy electronicboy commented Sep 5, 2026

Copy link
Copy Markdown
Member

Adds 26.3-pre-3 support behind the existing net.md_5.bungee.protocol.snapshot flag, as a single temporary patch to be dropped once upstream lands its own 26.3 support.

MINECRAFT_26_3 holds the snapshot protocol number (0x40000000 | 335), matching what upstream does during a pre-release cycle before flipping it to the release number.

Packet id remaps

Relative to 26.2, 26.3 inserts post_effects into both the configuration and game clientbound tables, swing_animation into the game clientbound table, and, as of pre-3, add_transient_block at game clientbound 0x25. That last one sits low enough to shift almost the whole table, so 25 of the game clientbound packets we register move, on top of the 7 configuration ones.

Serverbound is unaffected for us: 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 derived from the registration order in GameProtocols and ConfigurationProtocols rather 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.

CommonPlayerSpawnInfo

The one packet payload change, affecting both Login and Respawn, which embed it:

  • gameType: byte -> var int
  • previousGameType: byte with a -1 sentinel -> 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, 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 FriendlyByteBuf to StreamCodec refactor with an identical wire format — including PlayerListItemUpdate, whose new Action id is enum-internal and not serialised, and Team, whose Collection<String> to List<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_provider and slot_source after loot_modifier, then feature and swing_animation after dialog, which also shifts 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:

io.netty.handler.codec.DecoderException: java.lang.ArrayIndexOutOfBoundsException: Index 59 out of bounds for length 57
	at net.md_5.bungee.protocol.packet.Commands$ArgumentRegistry.read(Commands.java:1006)

26.3 likewise adds a post_effects suggestion provider. Those are keyed by name rather than index and SuggestionRegistry.getProvider rejects 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. The pre-2 to pre-3 delta is packet ids only — no payload or registry changes — and has been verified against the registration order but not yet exercised at runtime.

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.
@electronicboy
electronicboy merged commit 2842000 into master Sep 7, 2026
2 checks passed
@electronicboy electronicboy changed the title Add 26.3-pre-2 protocol support Add 26.3-pre-3 protocol support Sep 8, 2026
electronicboy added a commit that referenced this pull request Sep 9, 2026
Master ended up with three patches numbered 0067 and both halves of the same
temporary protocol patch. #877 added 0067-Test-that-framed-packets-are-always-
direct and 0068-Cipher-into-a-direct-buffer-in-JavaCipher, then #876 added
0067-Temp-26.3-pre-2-protocol-support against an older base, and #878 was meant
to rename that to pre-3 but landed as an add, leaving the pre-2 file behind.

applyPatches.sh globs the directory, so the two Temp patches both applied in
lexicographic order and the second conflicted with the first:

    Applying: Temp: 26.3-pre-3 protocol support
    CONFLICT (content): Merge conflict in ProtocolConstants.java
    CONFLICT (content): Merge conflict in Protocol.java

Drop the superseded pre-2 file and renumber pre-3 to 0069 so it sits after
#877's patches. The patch content is byte for byte what #878 merged; only the
number and the parent it was generated against change.
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.

1 participant