diff --git a/src/main/java/net/minestom/server/network/packet/PacketWriting.java b/src/main/java/net/minestom/server/network/packet/PacketWriting.java index d93e38694..8736388d9 100644 --- a/src/main/java/net/minestom/server/network/packet/PacketWriting.java +++ b/src/main/java/net/minestom/server/network/packet/PacketWriting.java @@ -202,6 +202,7 @@ public final class PacketWriting { if (written < minWrite) { // Try again with a bigger buffer final long newSize = Math.min(buffer.capacity() * 2, ServerFlag.MAX_PACKET_SIZE); + if (newSize == buffer.capacity()) break; // We reached the maximum size buffer.resize(newSize); } else { // At least one packet has been written