mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-02 08:50:26 +01:00
Don't use addFirst for the proxy handler
This commit is contained in:
parent
de40ad3312
commit
683e55c3a0
@ -64,6 +64,10 @@ public class Proxy2ServerChannelInitializer extends MinecraftChannelInitializer
|
||||
new ProtocolPipelineImpl(user);
|
||||
ProxyConnection.fromChannel(channel).setUserConnection(user);
|
||||
|
||||
if (Options.PROXY_URL != null) {
|
||||
channel.pipeline().addLast("viaproxy-proxy-handler", this.getProxyHandler());
|
||||
}
|
||||
|
||||
super.initChannel(channel);
|
||||
channel.attr(MCPipeline.PACKET_REGISTRY_ATTRIBUTE_KEY).set(PacketRegistryUtil.getHandshakeRegistry(true));
|
||||
channel.pipeline().addBefore(MCPipeline.PACKET_CODEC_HANDLER_NAME, VPHPipeline.ENCODER_HANDLER_NAME, new VPHEncodeHandler(user));
|
||||
@ -75,10 +79,6 @@ public class Proxy2ServerChannelInitializer extends MinecraftChannelInitializer
|
||||
channel.pipeline().addBefore(MCPipeline.SIZER_HANDLER_NAME, VPHPipeline.PRE_NETTY_DECODER_HANDLER_NAME, new PreNettyDecoder(user));
|
||||
}
|
||||
|
||||
if (Options.PROXY_URL != null) {
|
||||
channel.pipeline().addFirst("viaproxy-proxy-handler", this.getProxyHandler());
|
||||
}
|
||||
|
||||
if (PluginManager.EVENT_MANAGER.call(new Proxy2ServerChannelInitializeEvent(ITyped.Type.POST, channel)).isCancelled()) {
|
||||
channel.close();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user