Skip to content

Commit 6d21992

Browse files
Update code examples
1 parent 4e2a8b5 commit 6d21992

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Here is an example implementation:
120120
public class CustomVLPipeline extends VLPipeline {
121121

122122
public CustomVLPipeline(UserConnection connection) {
123-
super(user);
123+
super(connection);
124124
}
125125

126126
// Replace these with the names of your pipeline components
@@ -146,21 +146,21 @@ The same can be done for the `VLLegacyPipeline` with similar functions for the d
146146
Then you can add the Via* pipeline to your netty pipeline:
147147
```java
148148
final UserConnection connection = new UserConnectionImpl(channel, true/*clientside or serverside*/);
149-
new ProtocolPipelineImpl(user);
149+
new ProtocolPipelineImpl(connection);
150150

151-
channel.pipeline().addLast(new CustomVLPipeline(user));
151+
channel.pipeline().addLast(new CustomVLPipeline(connection));
152152
```
153153

154154
Both `VLPipeline` and `VLLegacyPipeline` contain various functions allowing you to modify/wrap the existing pipeline elements,
155155
if you need a more complex/dynamic pipeline setup you can also manually add the Via* handlers to the pipeline.
156156
Here is an example implementation:
157157
```java
158158
final UserConnection connection = new UserConnectionImpl(channel, true/*clientside or serverside*/);
159-
new ProtocolPipelineImpl(user);
159+
new ProtocolPipelineImpl(connection);
160160

161-
//channel.pipeline().addBefore("packet_decoder", VLLegacyPipeline.VIA_DECODER_NAME, new ViaDecoder(user));
162-
//channel.pipeline().addBefore("packet_encoder", VLLegacyPipeline.VIA_ENCODER_NAME, new ViaEncoder(user));
163-
channel.pipeline().addBefore("packet_codec", VLPipeline.VIA_CODEC_NAME, new ViaCodec(user));
161+
//channel.pipeline().addBefore("packet_decoder", VLLegacyPipeline.VIA_DECODER_NAME, new ViaDecoder(connection));
162+
//channel.pipeline().addBefore("packet_encoder", VLLegacyPipeline.VIA_ENCODER_NAME, new ViaEncoder(connection));
163+
channel.pipeline().addBefore("packet_codec", VLPipeline.VIA_CODEC_NAME, new ViaCodec(connection));
164164
```
165165
If you are using ViaLegacy, you should read its [README](https://github.com/ViaVersion/ViaLegacy?tab=readme-ov-file#vialegacy) to see what changes you need to make to the netty pipeline for it to work.
166166

0 commit comments

Comments
 (0)