mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-09 01:47:54 +01:00
Use pooled buffer to prevent reallocation when copying
This commit is contained in:
parent
8975161edb
commit
cdfa0dcfde
@ -16,6 +16,7 @@ import net.minestom.server.network.netty.codec.PacketCompressor;
|
||||
import net.minestom.server.network.netty.packet.FramedPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.login.SetCompressionPacket;
|
||||
import net.minestom.server.utils.BufUtils;
|
||||
import net.minestom.server.utils.PacketUtils;
|
||||
import net.minestom.server.utils.cache.CacheablePacket;
|
||||
import net.minestom.server.utils.cache.TemporaryCache;
|
||||
@ -61,7 +62,7 @@ public class NettyPlayerConnection extends PlayerConnection {
|
||||
private PlayerSkin bungeeSkin;
|
||||
|
||||
private static final int FLUSH_SIZE = 20000;
|
||||
private final ByteBuf tickBuffer = Unpooled.directBuffer();
|
||||
private final ByteBuf tickBuffer = BufUtils.getBuffer(true);
|
||||
|
||||
public NettyPlayerConnection(@NotNull SocketChannel channel) {
|
||||
super();
|
||||
|
Loading…
Reference in New Issue
Block a user