From c77c490324169a82a3533bad1238fec35c54ce33 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 30 Mar 2020 09:11:26 +1300 Subject: [PATCH] Catch throwables not just normal exceptions --- .../utilities/packets/packetlisteners/PacketListenerMain.java | 2 +- .../packets/packetlisteners/PacketListenerViewSelfDisguise.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java index 8da6f903..0855bf2b 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java @@ -51,7 +51,7 @@ public class PacketListenerMain extends PacketAdapter { packets = PacketsManager.getPacketsHandler() .transformPacket(event.getPacket(), disguise, observer, disguise.getEntity()); } - catch (Exception ex) { + catch (Throwable ex) { ex.printStackTrace(); event.setCancelled(true); return; diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java index 93b20d47..64ffb58d 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java @@ -183,7 +183,7 @@ public class PacketListenerViewSelfDisguise extends PacketAdapter { DisguiseUtilities.setPlayerVelocity(null); } } - catch (Exception ex) { + catch (Throwable ex) { event.setCancelled(true); ex.printStackTrace(); }