java.lang.Object
net.minestom.server.network.packet.PacketWriting
Tools to write packets into a
NetworkBuffer
for network processing.
Fairly internal and performance sensitive.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NetworkBuffer
allocateTrimmedPacket
(ConnectionState state, ClientPacket packet, int compressionThreshold) static NetworkBuffer
allocateTrimmedPacket
(ConnectionState state, ServerPacket packet, int compressionThreshold) static <T> NetworkBuffer
allocateTrimmedPacket
(NetworkBuffer tmpBuffer, PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold) static <T> NetworkBuffer
allocateTrimmedPacket
(NetworkBuffer tmpBuffer, PacketRegistry<T> registry, T packet, int compressionThreshold) static <T> NetworkBuffer
allocateTrimmedPacket
(PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold) static void
writeFramedPacket
(NetworkBuffer buffer, ConnectionState state, ClientPacket packet, int compressionThreshold) static void
writeFramedPacket
(NetworkBuffer buffer, ConnectionState state, ServerPacket packet, int compressionThreshold) static <T> void
writeFramedPacket
(NetworkBuffer buffer, NetworkBuffer.Type<T> type, int id, T packet, int compressionThreshold) static <T> void
writeFramedPacket
(NetworkBuffer buffer, PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold) static <T> void
writeFramedPacket
(NetworkBuffer buffer, PacketRegistry.PacketInfo<T> packetInfo, T packet, int compressionThreshold) static <T> void
writeFramedPacket
(NetworkBuffer buffer, PacketRegistry<T> registry, T packet, int compressionThreshold) static <T> void
writeQueue
(NetworkBuffer buffer, Queue<T> queue, int minWrite, BiPredicate<NetworkBuffer, T> writer)
-
Constructor Details
-
PacketWriting
public PacketWriting()
-
-
Method Details
-
writeFramedPacket
public static void writeFramedPacket(NetworkBuffer buffer, ConnectionState state, ClientPacket packet, int compressionThreshold) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
writeFramedPacket
public static void writeFramedPacket(NetworkBuffer buffer, ConnectionState state, ServerPacket packet, int compressionThreshold) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
writeFramedPacket
public static <T> void writeFramedPacket(NetworkBuffer buffer, PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
writeFramedPacket
public static <T> void writeFramedPacket(NetworkBuffer buffer, PacketRegistry<T> registry, T packet, int compressionThreshold) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
writeFramedPacket
public static <T> void writeFramedPacket(NetworkBuffer buffer, PacketRegistry.PacketInfo<T> packetInfo, T packet, int compressionThreshold) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
writeFramedPacket
public static <T> void writeFramedPacket(NetworkBuffer buffer, NetworkBuffer.Type<T> type, int id, T packet, int compressionThreshold) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
allocateTrimmedPacket
public static NetworkBuffer allocateTrimmedPacket(ConnectionState state, ClientPacket packet, int compressionThreshold) -
allocateTrimmedPacket
public static NetworkBuffer allocateTrimmedPacket(ConnectionState state, ServerPacket packet, int compressionThreshold) -
allocateTrimmedPacket
public static <T> NetworkBuffer allocateTrimmedPacket(PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold) -
allocateTrimmedPacket
public static <T> NetworkBuffer allocateTrimmedPacket(NetworkBuffer tmpBuffer, PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold) -
allocateTrimmedPacket
public static <T> NetworkBuffer allocateTrimmedPacket(NetworkBuffer tmpBuffer, PacketRegistry<T> registry, T packet, int compressionThreshold) -
writeQueue
public static <T> void writeQueue(NetworkBuffer buffer, Queue<T> queue, int minWrite, BiPredicate<NetworkBuffer, T> writer)
-