From d277701caaf22be54b9bef100952b601c568d2a2 Mon Sep 17 00:00:00 2001 From: Matsv Date: Mon, 14 Nov 2016 21:13:18 +0100 Subject: [PATCH] Ignore if the setMainHand doesn't exist --- .../myles/ViaVersion/bungee/listeners/MainHandPatch.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bungee/src/main/java/us/myles/ViaVersion/bungee/listeners/MainHandPatch.java b/bungee/src/main/java/us/myles/ViaVersion/bungee/listeners/MainHandPatch.java index 57dd0b8e1..67af397ee 100644 --- a/bungee/src/main/java/us/myles/ViaVersion/bungee/listeners/MainHandPatch.java +++ b/bungee/src/main/java/us/myles/ViaVersion/bungee/listeners/MainHandPatch.java @@ -22,13 +22,16 @@ public class MainHandPatch implements Listener { try { getSettings = Class.forName("net.md_5.bungee.UserConnection").getDeclaredMethod("getSettings"); setMainHand = Class.forName("net.md_5.bungee.protocol.packet.ClientSettings").getDeclaredMethod("setMainHand", int.class); - } catch (NoSuchMethodException | ClassNotFoundException e) { - e.printStackTrace(); + } catch (Exception ignored) { } } @EventHandler public void onServerConnect(ServerConnectEvent event) { + // Ignore if it doesn't exist (Like BungeeCord 1.8) + if (setMainHand == null) + return; + UserConnection user = Via.getManager().getConnection(event.getPlayer().getUniqueId()); try {