Class PacketWriting
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 NetworkBufferallocateTrimmedPacket(ConnectionState state, ClientPacket packet, int compressionThreshold) static NetworkBufferallocateTrimmedPacket(ConnectionState state, ClientPacket packet, int compressionThreshold, Registries registries) static NetworkBufferallocateTrimmedPacket(ConnectionState state, ServerPacket packet, int compressionThreshold) static NetworkBufferallocateTrimmedPacket(ConnectionState state, ServerPacket packet, int compressionThreshold, Registries registries) static <T> NetworkBufferallocateTrimmedPacket(NetworkBuffer tmpBuffer, PacketParser<? super T> parser, ConnectionState state, T packet, int compressionThreshold) static <T> NetworkBufferallocateTrimmedPacket(NetworkBuffer tmpBuffer, PacketRegistry<? super T> registry, T packet, int compressionThreshold) static <T> NetworkBufferallocateTrimmedPacket(PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold) static <T> NetworkBufferallocateTrimmedPacket(PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold, Registries registries) static voidwriteFramedPacket(NetworkBuffer buffer, ConnectionState state, ClientPacket packet, int compressionThreshold) static voidwriteFramedPacket(NetworkBuffer buffer, ConnectionState state, ServerPacket packet, int compressionThreshold) static <T> voidwriteFramedPacket(NetworkBuffer buffer, NetworkBuffer.Type<? super T> type, int id, T packet, int compressionThreshold) static <T> voidwriteFramedPacket(NetworkBuffer buffer, PacketParser<? super T> parser, ConnectionState state, T packet, int compressionThreshold) static <T> voidwriteFramedPacket(NetworkBuffer buffer, PacketRegistry.PacketInfo<? super T> packetInfo, T packet, int compressionThreshold) static <T> voidwriteFramedPacket(NetworkBuffer buffer, PacketRegistry<? super T> registry, T packet, int compressionThreshold) static <T> voidwriteQueue(NetworkBuffer buffer, org.jctools.queues.MessagePassingQueue<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<? super T> parser, ConnectionState state, T packet, int compressionThreshold) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
writeFramedPacket
public static <T> void writeFramedPacket(NetworkBuffer buffer, PacketRegistry<? super T> registry, T packet, int compressionThreshold) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
writeFramedPacket
public static <T> void writeFramedPacket(NetworkBuffer buffer, PacketRegistry.PacketInfo<? super T> packetInfo, T packet, int compressionThreshold) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
writeFramedPacket
public static <T> void writeFramedPacket(NetworkBuffer buffer, NetworkBuffer.Type<? super 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, ClientPacket packet, int compressionThreshold, Registries registries) -
allocateTrimmedPacket
public static NetworkBuffer allocateTrimmedPacket(ConnectionState state, ServerPacket packet, int compressionThreshold) -
allocateTrimmedPacket
public static NetworkBuffer allocateTrimmedPacket(ConnectionState state, ServerPacket packet, int compressionThreshold, Registries registries) -
allocateTrimmedPacket
public static <T> NetworkBuffer allocateTrimmedPacket(PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold) -
allocateTrimmedPacket
public static <T> NetworkBuffer allocateTrimmedPacket(PacketParser<T> parser, ConnectionState state, T packet, int compressionThreshold, Registries registries) -
allocateTrimmedPacket
public static <T> NetworkBuffer allocateTrimmedPacket(NetworkBuffer tmpBuffer, PacketParser<? super T> parser, ConnectionState state, T packet, int compressionThreshold) -
allocateTrimmedPacket
public static <T> NetworkBuffer allocateTrimmedPacket(NetworkBuffer tmpBuffer, PacketRegistry<? super T> registry, T packet, int compressionThreshold) -
writeQueue
public static <T> void writeQueue(NetworkBuffer buffer, org.jctools.queues.MessagePassingQueue<T> queue, int minWrite, BiPredicate<NetworkBuffer, T> writer)
-