From 69b702b653bf797bc5b24b8407c0484e3760accb Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Mon, 3 Sep 2018 15:21:13 -0300 Subject: [PATCH] Remove VRProtocolPipeline --- .../MixinNetworkManagerClientChInit.java | 5 ++- .../viarift/protocol/VRProtocolPipeline.java | 40 ------------------- 2 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 src/main/java/com/github/creeper123123321/viarift/protocol/VRProtocolPipeline.java diff --git a/src/main/java/com/github/creeper123123321/viarift/mixin/MixinNetworkManagerClientChInit.java b/src/main/java/com/github/creeper123123321/viarift/mixin/MixinNetworkManagerClientChInit.java index 83b1d64..20efa12 100644 --- a/src/main/java/com/github/creeper123123321/viarift/mixin/MixinNetworkManagerClientChInit.java +++ b/src/main/java/com/github/creeper123123321/viarift/mixin/MixinNetworkManagerClientChInit.java @@ -27,7 +27,7 @@ package com.github.creeper123123321.viarift.mixin; import com.github.creeper123123321.viarift.handler.VRInHandler; import com.github.creeper123123321.viarift.handler.VROutHandler; import com.github.creeper123123321.viarift.platform.VRUserConnection; -import com.github.creeper123123321.viarift.protocol.VRProtocolPipeline; +import com.github.creeper123123321.viarift.protocol.Interceptor; import io.netty.channel.Channel; import io.netty.channel.socket.SocketChannel; import io.netty.handler.codec.ByteToMessageDecoder; @@ -37,6 +37,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import us.myles.ViaVersion.api.data.UserConnection; +import us.myles.ViaVersion.api.protocol.ProtocolPipeline; @Mixin(targets = "net.minecraft.network.NetworkManager$1") public class MixinNetworkManagerClientChInit { @@ -44,7 +45,7 @@ public class MixinNetworkManagerClientChInit { private void onInitChannel(Channel channel, CallbackInfo ci) { if (channel instanceof SocketChannel) { UserConnection user = new VRUserConnection((SocketChannel) channel); - new VRProtocolPipeline(user); + new ProtocolPipeline(user).add(new Interceptor()); MessageToByteEncoder oldEncoder = (MessageToByteEncoder) channel.pipeline().get("encoder"); ByteToMessageDecoder oldDecoder = (ByteToMessageDecoder) channel.pipeline().get("decoder"); diff --git a/src/main/java/com/github/creeper123123321/viarift/protocol/VRProtocolPipeline.java b/src/main/java/com/github/creeper123123321/viarift/protocol/VRProtocolPipeline.java deleted file mode 100644 index 8fff8ee..0000000 --- a/src/main/java/com/github/creeper123123321/viarift/protocol/VRProtocolPipeline.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2018 creeper123123321 and contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.github.creeper123123321.viarift.protocol; - -import us.myles.ViaVersion.api.data.UserConnection; -import us.myles.ViaVersion.api.protocol.ProtocolPipeline; - -public class VRProtocolPipeline extends ProtocolPipeline { - public VRProtocolPipeline(UserConnection userConnection) { - super(userConnection); - } - - @Override - protected void registerPackets() { - super.registerPackets(); - add(new Interceptor()); - } -}