Skip to content

Commit

Permalink
Replace ProtocolVersion#isKnown usages with isRegistered in pipeline …
Browse files Browse the repository at this point in the history
…classes
  • Loading branch information
FlorianMichael committed Oct 15, 2024
1 parent b0de353 commit 06f8dc0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/raphimc/vialoader/netty/VLPipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 06f8dc0

Please sign in to comment.