Class ClientPacketsHandler
java.lang.Object
net.minestom.server.network.packet.client.ClientPacketsHandler
- Direct Known Subclasses:
ClientPacketsHandler.Configuration
,ClientPacketsHandler.Login
,ClientPacketsHandler.Play
,ClientPacketsHandler.Status
public sealed class ClientPacketsHandler
extends Object
permits ClientPacketsHandler.Status, ClientPacketsHandler.Login, ClientPacketsHandler.Configuration, ClientPacketsHandler.Play
Contains registered packets and a way to instantiate them.
Packets are registered using register(int, Function)
and created using create(int, NetworkBuffer)
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
static final class
static final class
-
Method Summary
Modifier and TypeMethodDescription@UnknownNullability ClientPacket
create
(int packetId, @NotNull NetworkBuffer reader) void
register
(int id, @NotNull Function<@NotNull NetworkBuffer, @NotNull ClientPacket> packetSupplier)
-
Method Details
-
register
public void register(int id, @NotNull @NotNull Function<@NotNull NetworkBuffer, @NotNull ClientPacket> packetSupplier) -
create
public @UnknownNullability ClientPacket create(int packetId, @NotNull @NotNull NetworkBuffer reader)
-