Skip to content

Commit

Permalink
add clean error handler for invalid thread in network interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 26, 2021
1 parent 81b4c00 commit 8884752
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -163,6 +163,12 @@ public void send(Packet<?> packet, GenericFutureListener<? extends Future<? supe
if (NMSHandler.debugPackets) {
Debug.log("Packet: " + packet.getClass().getCanonicalName() + " sent to " + player.getScoreboardName());
}
if (!Bukkit.isPrimaryThread()) {
if (Debug.verbose) {
Debug.log("Warning: packet sent off main thread! This is completely unsupported behavior! Denizen network inteceptor ignoring packet to avoid crash. Packet class: " + packet.getClass().getCanonicalName() + " sent to " + player.getScoreboardName());
}
return;
}
packetsSent++;
if (processAttachToForPacket(packet)
|| processHiddenEntitiesForPacket(packet)
Expand Down

0 comments on commit 8884752

Please sign in to comment.