From 96fe9f1063f514edaceaea8e0b65a88ad08d5fb5 Mon Sep 17 00:00:00 2001 From: TheMode Date: Mon, 10 May 2021 11:03:58 +0200 Subject: [PATCH] Framed packet cleanup 4 --- src/main/java/net/minestom/server/utils/PacketUtils.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/net/minestom/server/utils/PacketUtils.java b/src/main/java/net/minestom/server/utils/PacketUtils.java index 6acb355c8..6d819748e 100644 --- a/src/main/java/net/minestom/server/utils/PacketUtils.java +++ b/src/main/java/net/minestom/server/utils/PacketUtils.java @@ -239,11 +239,9 @@ public final class PacketUtils { Utils.overrideVarIntHeader(buffer, dataLengthIndex, uncompressedLength); if (uncompressedLength > 0) { // Packet large enough, compress - final VelocityCompressor compressor = COMPRESSOR.get(); - // Compress id + payload ByteBuf uncompressedCopy = buffer.copy(contentIndex, packetSize); buffer.writerIndex(contentIndex); - compress(compressor, uncompressedCopy, buffer); + compress(COMPRESSOR.get(), uncompressedCopy, buffer); uncompressedCopy.release(); } } else {