File tree Expand file tree Collapse file tree
src/main/java/com/viaversion/fabric/common/protocol Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424import com .viaversion .viaversion .api .protocol .packet .ClientboundPacketType ;
2525import com .viaversion .viaversion .api .protocol .packet .ServerboundPacketType ;
2626import com .viaversion .viaversion .api .protocol .packet .State ;
27+ import com .viaversion .viaversion .api .protocol .version .ProtocolVersion ;
2728import com .viaversion .viaversion .api .type .Types ;
2829import com .viaversion .viaversion .protocols .base .ServerboundHandshakePackets ;
2930import com .viaversion .viaversion .util .Key ;
@@ -57,7 +58,8 @@ protected void registerPackets() {
5758 // Fixes an issue where the Fabric Particle API causes disconnects when both the client and server have the mod installed and both are 1.21.5+.
5859 // See https://github.com/ViaVersion/ViaFabric/issues/428
5960 registerServerbound (customPayload , wrapper -> {
60- if (!wrapper .user ().getProtocolInfo ().serverProtocolVersion ().equals (wrapper .user ().getProtocolInfo ().protocolVersion ())) {
61+ final ProtocolVersion serverVersion = wrapper .user ().getProtocolInfo ().serverProtocolVersion ();
62+ if (serverVersion .newerThanOrEqualTo (ProtocolVersion .v1_21_5 ) && !serverVersion .equals (wrapper .user ().getProtocolInfo ().protocolVersion ())) {
6163 final String channel = Key .namespaced (wrapper .passthrough (Types .STRING ));
6264 if (channel .equals ("minecraft:register" ) || channel .equals ("minecraft:unregister" )) {
6365 final List <String > channels = Lists .newArrayList (new String (wrapper .passthrough (Types .SERVERBOUND_CUSTOM_PAYLOAD_DATA ), StandardCharsets .UTF_8 ).split ("\0 " ));
You can’t perform that action at this time.
0 commit comments