diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/protocol/PacketThreadUtilMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/protocol/PacketThreadUtilMixin.java index a32ba002..a9d47e73 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/protocol/PacketThreadUtilMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/network/protocol/PacketThreadUtilMixin.java @@ -33,7 +33,14 @@ public class PacketThreadUtilMixin { return; } if (processor.getConnection().isConnected()) { - packetIn.handle(processor); + try { + packetIn.handle(processor); + } catch (Exception exception) { + if (processor.shouldPropagateHandlingExceptions()) { + throw exception; + } + LOGGER.error("Failed to handle packet {}, suppressing error", packetIn, exception); + } } else { LOGGER.debug("Ignoring packet due to disconnection: " + packetIn); }