Remove VRProtocolPipeline

This commit is contained in:
creeper123123321 2018-09-03 15:21:13 -03:00
parent 7affe9f332
commit 69b702b653
2 changed files with 3 additions and 42 deletions

View File

@ -27,7 +27,7 @@ package com.github.creeper123123321.viarift.mixin;
import com.github.creeper123123321.viarift.handler.VRInHandler; import com.github.creeper123123321.viarift.handler.VRInHandler;
import com.github.creeper123123321.viarift.handler.VROutHandler; import com.github.creeper123123321.viarift.handler.VROutHandler;
import com.github.creeper123123321.viarift.platform.VRUserConnection; 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.Channel;
import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.ByteToMessageDecoder; 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.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.ProtocolPipeline;
@Mixin(targets = "net.minecraft.network.NetworkManager$1") @Mixin(targets = "net.minecraft.network.NetworkManager$1")
public class MixinNetworkManagerClientChInit { public class MixinNetworkManagerClientChInit {
@ -44,7 +45,7 @@ public class MixinNetworkManagerClientChInit {
private void onInitChannel(Channel channel, CallbackInfo ci) { private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel) { if (channel instanceof SocketChannel) {
UserConnection user = new VRUserConnection((SocketChannel) channel); UserConnection user = new VRUserConnection((SocketChannel) channel);
new VRProtocolPipeline(user); new ProtocolPipeline(user).add(new Interceptor());
MessageToByteEncoder oldEncoder = (MessageToByteEncoder) channel.pipeline().get("encoder"); MessageToByteEncoder oldEncoder = (MessageToByteEncoder) channel.pipeline().get("encoder");
ByteToMessageDecoder oldDecoder = (ByteToMessageDecoder) channel.pipeline().get("decoder"); ByteToMessageDecoder oldDecoder = (ByteToMessageDecoder) channel.pipeline().get("decoder");

View File

@ -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());
}
}