From 06f8dc079a33cd82ad029c320ed9272f6040582f Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Tue, 15 Oct 2024 14:10:39 +0200 Subject: [PATCH] Replace ProtocolVersion#isKnown usages with isRegistered in pipeline classes --- src/main/java/net/raphimc/vialoader/netty/VLLegacyPipeline.java | 2 +- src/main/java/net/raphimc/vialoader/netty/VLPipeline.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/raphimc/vialoader/netty/VLLegacyPipeline.java b/src/main/java/net/raphimc/vialoader/netty/VLLegacyPipeline.java index b5a3322..8ac2085 100644 --- a/src/main/java/net/raphimc/vialoader/netty/VLLegacyPipeline.java +++ b/src/main/java/net/raphimc/vialoader/netty/VLLegacyPipeline.java @@ -63,7 +63,7 @@ public void handlerAdded(ChannelHandlerContext ctx) { if (this.user.isClientSide()) { final ProtocolVersion r1_6_4 = ProtocolVersion.getProtocol(VersionType.RELEASE_INITIAL, 78); - if (r1_6_4.isKnown() && this.version.olderThanOrEqualTo(r1_6_4)) { + if (ProtocolVersion.isRegistered(r1_6_4.getVersionType(), r1_6_4.getOriginalVersion()) && this.version.olderThanOrEqualTo(r1_6_4)) { ctx.pipeline().addBefore(this.lengthSplitterName(), VIALEGACY_PRE_NETTY_LENGTH_PREPENDER_NAME, this.createViaLegacyPreNettyLengthPrepender()); ctx.pipeline().addBefore(this.lengthPrependerName(), VIALEGACY_PRE_NETTY_LENGTH_REMOVER_NAME, this.createViaLegacyPreNettyLengthRemover()); } else if (this.version.getName().startsWith("Bedrock")) { diff --git a/src/main/java/net/raphimc/vialoader/netty/VLPipeline.java b/src/main/java/net/raphimc/vialoader/netty/VLPipeline.java index 54d7102..4463901 100644 --- a/src/main/java/net/raphimc/vialoader/netty/VLPipeline.java +++ b/src/main/java/net/raphimc/vialoader/netty/VLPipeline.java @@ -60,7 +60,7 @@ public void handlerAdded(ChannelHandlerContext ctx) { if (this.user.isClientSide()) { final ProtocolVersion r1_6_4 = ProtocolVersion.getProtocol(VersionType.RELEASE_INITIAL, 78); - if (r1_6_4.isKnown() && this.version.olderThanOrEqualTo(r1_6_4)) { + if (ProtocolVersion.isRegistered(r1_6_4.getVersionType(), r1_6_4.getOriginalVersion()) && this.version.olderThanOrEqualTo(r1_6_4)) { ctx.pipeline().addBefore(this.lengthCodecName(), VIALEGACY_PRE_NETTY_LENGTH_CODEC_NAME, this.createViaLegacyPreNettyLengthCodec()); } else if (this.version.getName().startsWith("Bedrock")) { ctx.pipeline().addBefore(this.lengthCodecName(), VIABEDROCK_DISCONNECT_HANDLER_NAME, this.createViaBedrockDisconnectHandler());