From 9393d805ece1cd5877afebe34a6441f68c114d59 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Wed, 22 Aug 2018 15:18:46 -0300 Subject: [PATCH] Do not return succeeded future if there was a exception --- .../java/com/github/creeper123123321/viarift/ViaRift.java | 2 +- .../viarift/mixin/client/MixinGuiMultiplayer.java | 5 ----- .../creeper123123321/viarift/platform/VRUserConnection.java | 3 ++- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/github/creeper123123321/viarift/ViaRift.java b/src/main/java/com/github/creeper123123321/viarift/ViaRift.java index 068e02c..59e7984 100644 --- a/src/main/java/com/github/creeper123123321/viarift/ViaRift.java +++ b/src/main/java/com/github/creeper123123321/viarift/ViaRift.java @@ -15,7 +15,7 @@ import us.myles.ViaVersion.ViaManager; import us.myles.ViaVersion.api.Via; public class ViaRift implements InitializationListener { - public static int fakeServerVersion = 393; // TODO + public static int fakeServerVersion = 393; public static final Logger LOGGER = LogManager.getLogger(); public static final java.util.logging.Logger JLOGGER = new JLoggerToLog4j(LOGGER); public static final EventLoop EVENT_LOOP = new DefaultEventLoop(); diff --git a/src/main/java/com/github/creeper123123321/viarift/mixin/client/MixinGuiMultiplayer.java b/src/main/java/com/github/creeper123123321/viarift/mixin/client/MixinGuiMultiplayer.java index 299fcda..ac026f7 100644 --- a/src/main/java/com/github/creeper123123321/viarift/mixin/client/MixinGuiMultiplayer.java +++ b/src/main/java/com/github/creeper123123321/viarift/mixin/client/MixinGuiMultiplayer.java @@ -34,11 +34,6 @@ public abstract class MixinGuiMultiplayer extends GuiScreen { protocolVersion.func_195608_a(p_1, p_2, p_3); } - //@Inject(method = "keyPressed", at = @At("TAIL")) - //private void onKeyPressed(int p_1, int p_2, int p_3, CallbackInfoReturnable cir) { - // protocolVersion.keyPressed(p_1, p_2, p_3); - //} - @Inject(method = "updateScreen", at = @At("TAIL")) private void onUpdateScreen(CallbackInfo ci) { protocolVersion.updateCursorCounter(); diff --git a/src/main/java/com/github/creeper123123321/viarift/platform/VRUserConnection.java b/src/main/java/com/github/creeper123123321/viarift/platform/VRUserConnection.java index c5deee8..e93692a 100644 --- a/src/main/java/com/github/creeper123123321/viarift/platform/VRUserConnection.java +++ b/src/main/java/com/github/creeper123123321/viarift/platform/VRUserConnection.java @@ -57,9 +57,10 @@ public class VRUserConnection extends UserConnection { final Channel channel = this.getChannel(); try { PipelineUtil.getContextBefore("decoder", channel.pipeline()).fireChannelRead(copy); + return channel.newSucceededFuture(); } catch (Exception e) { e.printStackTrace(); + return channel.newFailedFuture(e); } - return channel.newSucceededFuture(); } }