Skip to content

Commit c1e1269

Browse files
committed
[ci skip] Also check for >= 1.21.5 when comparing
1 parent 3d74975 commit c1e1269

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/com/viaversion/fabric/common/protocol/ViaFabricProtocolBase.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
2525
import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
2626
import com.viaversion.viaversion.api.protocol.packet.State;
27+
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
2728
import com.viaversion.viaversion.api.type.Types;
2829
import com.viaversion.viaversion.protocols.base.ServerboundHandshakePackets;
2930
import 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"));

0 commit comments

Comments
 (0)