From d323845264d9bedab18771de76bb5fec8e7c165c Mon Sep 17 00:00:00 2001 From: Ferdinand Date: Thu, 24 Dec 2020 21:52:45 +0100 Subject: [PATCH] Update NBTTagCompoundPacketHandler.java --- .../handlers/NBTTagCompoundPacketHandler.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/fexcraft/lib/mc/network/handlers/NBTTagCompoundPacketHandler.java b/src/main/java/net/fexcraft/lib/mc/network/handlers/NBTTagCompoundPacketHandler.java index 14803e3..0d21028 100644 --- a/src/main/java/net/fexcraft/lib/mc/network/handlers/NBTTagCompoundPacketHandler.java +++ b/src/main/java/net/fexcraft/lib/mc/network/handlers/NBTTagCompoundPacketHandler.java @@ -32,7 +32,13 @@ public void run(){ } IPacketListener listener = sls.get(packet.nbt.getString("target_listener")); if(listener != null){ - listener.process(packet, new Object[]{ctx.getServerHandler().player}); + try{ + listener.process(packet, new Object[]{ ctx.getServerHandler().player }); + } + catch(Throwable thr){ + Print.log("ERROR on processing NBT Packet: " + packet.nbt.toString()); + thr.printStackTrace(); + } } } }); @@ -54,7 +60,13 @@ public void run(){ } IPacketListener listener = cls.get(packet.nbt.getString("target_listener")); if(listener != null){ - listener.process(packet, new Object[]{Minecraft.getMinecraft().player}); + try{ + listener.process(packet, new Object[]{ Minecraft.getMinecraft().player }); + } + catch(Throwable thr){ + Print.log("ERROR on processing NBT Packet: " + packet.nbt.toString()); + thr.printStackTrace(); + } } } });