@@ -51,7 +51,6 @@ public VLLegacyPipeline(final UserConnection user) {
5151 this (user , Via .getManager ().getProviders ().get (VersionProvider .class ).getServerProtocol (user ));
5252 }
5353
54- @ Deprecated
5554 public VLLegacyPipeline (final UserConnection user , final ProtocolVersion version ) {
5655 this .user = user ;
5756 this .version = version ;
@@ -62,16 +61,18 @@ public void handlerAdded(ChannelHandlerContext ctx) {
6261 ctx .pipeline ().addBefore (this .packetDecoderName (), VIA_DECODER_NAME , this .createViaDecoder ());
6362 ctx .pipeline ().addBefore (this .packetEncoderName (), VIA_ENCODER_NAME , this .createViaEncoder ());
6463
65- final ProtocolVersion r1_6_4 = ProtocolVersion .getProtocol (VersionType .RELEASE_INITIAL , 78 );
66- if (r1_6_4 .isKnown () && this .version .olderThanOrEqualTo (r1_6_4 )) {
67- ctx .pipeline ().addBefore (this .lengthSplitterName (), VIALEGACY_PRE_NETTY_LENGTH_PREPENDER_NAME , this .createViaLegacyPreNettyLengthPrepender ());
68- ctx .pipeline ().addBefore (this .lengthPrependerName (), VIALEGACY_PRE_NETTY_LENGTH_REMOVER_NAME , this .createViaLegacyPreNettyLengthRemover ());
69- } else if (this .version .getName ().startsWith ("Bedrock" )) {
70- ctx .pipeline ().addBefore (this .lengthSplitterName (), VIABEDROCK_DISCONNECT_HANDLER_NAME , this .createViaBedrockDisconnectHandler ());
71- ctx .pipeline ().addBefore (this .lengthSplitterName (), VIABEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME , this .createViaBedrockFrameEncapsulationHandler ());
72- this .replaceLengthSplitter (ctx , this .createViaBedrockBatchLengthCodec ());
73- ctx .pipeline ().remove (this .lengthPrependerName ());
74- ctx .pipeline ().addBefore (VIA_DECODER_NAME , VIABEDROCK_PACKET_ENCAPSULATION_HANDLER_NAME , this .createViaBedrockPacketEncapsulationHandler ());
64+ if (this .user .isClientSide ()) {
65+ final ProtocolVersion r1_6_4 = ProtocolVersion .getProtocol (VersionType .RELEASE_INITIAL , 78 );
66+ if (r1_6_4 .isKnown () && this .version .olderThanOrEqualTo (r1_6_4 )) {
67+ ctx .pipeline ().addBefore (this .lengthSplitterName (), VIALEGACY_PRE_NETTY_LENGTH_PREPENDER_NAME , this .createViaLegacyPreNettyLengthPrepender ());
68+ ctx .pipeline ().addBefore (this .lengthPrependerName (), VIALEGACY_PRE_NETTY_LENGTH_REMOVER_NAME , this .createViaLegacyPreNettyLengthRemover ());
69+ } else if (this .version .getName ().startsWith ("Bedrock" )) {
70+ ctx .pipeline ().addBefore (this .lengthSplitterName (), VIABEDROCK_DISCONNECT_HANDLER_NAME , this .createViaBedrockDisconnectHandler ());
71+ ctx .pipeline ().addBefore (this .lengthSplitterName (), VIABEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME , this .createViaBedrockFrameEncapsulationHandler ());
72+ this .replaceLengthSplitter (ctx , this .createViaBedrockBatchLengthCodec ());
73+ ctx .pipeline ().remove (this .lengthPrependerName ());
74+ ctx .pipeline ().addBefore (VIA_DECODER_NAME , VIABEDROCK_PACKET_ENCAPSULATION_HANDLER_NAME , this .createViaBedrockPacketEncapsulationHandler ());
75+ }
7576 }
7677 }
7778
0 commit comments