-
Notifications
You must be signed in to change notification settings - Fork 0
Cross Version Support
Not Enough Spectators runs a small backend Netty server inside the host client and replays the host's captured 26.2 packets to spectators. ViaBridge treats that like a backend server with ViaVersion installed:
- At startup it boots a minimal Via platform whose server protocol version is 26.2, and loads ViaBackwards + ViaRewind for the full range of older clients.
- A Mixin into
SpectatorServerNetworkHandler#channelActiveinserts a server-sideViaDecodeHandler/ViaEncodeHandler(with a freshUserConnection) into every spectator channel. - Via detects each spectator's version from its handshake and translates
client <-> 26.2in both directions.
Check it with /nesvia.
Same-version (26.2) spectating works. Older-version spectating is currently blocked upstream, not by this mod.
A spectator on, e.g., 1.21.8 completes handshake, login, and the entire configuration phase — Via attaches and translates all the way through — then fails when the old client builds its registries from the received data:
Failed to load registries due to errors
... Failed to parse local data (chat_type, damage_type, dimension_type, enchantment, worldgen/biome, ...)
... Registry must be non-empty: minecraft:cat_variant, ...
The cause is that ViaBackwards has not yet finished converting 26.2's registry data down to older
versions. 26.2 added brand-new registries (sulfur_cube_archetype, dialog, wolf_sound_variant,
test_environment, …) that older clients don't understand and ViaBackwards must learn to
rewrite/strip. This is the same ViaBackwards used everywhere (ViaProxy, ViaFabric, …), so no
alternative setup avoids it.
As soon as ViaBackwards ships 26.2 down-conversion. The dependency tracks the ViaBackwards snapshot, so it starts working with just a refreshed rebuild — no code changes:
./gradlew build --refresh-dependencies