From ea6c648e4f2d064ad06c0a76224552b56a2e7fbc Mon Sep 17 00:00:00 2001 From: Myles Date: Wed, 2 Mar 2016 19:12:38 +0000 Subject: [PATCH] Fix spam, update to version 0.4.3 --- README.md | 2 +- .../myles/ViaVersion/handlers/ViaDecodeHandler.java | 10 +++++++--- .../myles/ViaVersion/handlers/ViaEncodeHandler.java | 12 ++++++++---- src/main/resources/plugin.yml | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bc2c9fdd7..9f045e42c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ViaVersion 0.4.2 +# ViaVersion 0.4.3 **Allows the connection of 1.8 clients to 1.9** This plugin modifies netty to allow connection of 1.9 clients to 1.8, diff --git a/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java b/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java index 72d7eb0b0..398f196e6 100644 --- a/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java +++ b/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java @@ -44,9 +44,13 @@ public class ViaDecodeHandler extends ByteToMessageDecoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if (!(cause.getCause() instanceof CancelException)) { - if (cause instanceof Exception) { - throw (Exception) cause; + if (!(cause.getCause().getCause() instanceof CancelException)) { + if (!(cause.getCause() instanceof CancelException)) { + if (!(cause instanceof CancelException)) { + System.out.println("throwing"); + if (cause instanceof Exception) + throw (Exception) cause; + } } } } diff --git a/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java b/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java index a3f2a814e..d78195a5b 100644 --- a/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java +++ b/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java @@ -53,7 +53,7 @@ public class ViaEncodeHandler extends MessageToByteEncoder { if (bytebuf.readableBytes() == 0) { throw new CancelException(); } - if(info.isActive()) { + if (info.isActive()) { int id = PacketUtil.readVarInt(bytebuf); // Transform ByteBuf oldPacket = bytebuf.copy(); @@ -71,9 +71,13 @@ public class ViaEncodeHandler extends MessageToByteEncoder { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - if(!(cause.getCause() instanceof CancelException)) { - if(cause instanceof Exception){ - throw (Exception) cause; + if (!(cause.getCause().getCause() instanceof CancelException)) { + if (!(cause.getCause() instanceof CancelException)) { + if (!(cause instanceof CancelException)) { + System.out.println("throwing"); + if (cause instanceof Exception) + throw (Exception) cause; + } } } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index a596db287..6ae0c6667 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ViaVersion main: us.myles.ViaVersion.ViaVersionPlugin author: _MylesC -version: 0.4.2 +version: 0.4.3 load: startup loadbefore: [ProtocolLib, ProxyPipe] \ No newline at end of file