Package org.moddingx.libx.network
Interface LoginPacketSerializer<T extends IntSupplier>
- All Superinterfaces:
PacketSerializer<T>
An interface that extends the logic in
PacketSerializer
to support login packets.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final record
A login packet. -
Method Summary
Modifier and TypeMethodDescriptiondefault List<LoginPacketSerializer.LoginPacket<T>>
buildLoginPackets
(boolean isLocal) Builds a list of login packets that are sent on login.int
getLoginIndex
(T msg) Gets the login packet index from the packet.default boolean
Gets whether this login packet needs a response.void
setLoginIndex
(T msg, int idx) Sets the login packet index to the packet.Methods inherited from interface org.moddingx.libx.network.PacketSerializer
decode, encode, messageClass
-
Method Details
-
getLoginIndex
Gets the login packet index from the packet. -
setLoginIndex
Sets the login packet index to the packet. -
buildLoginPackets
Builds a list of login packets that are sent on login. The default implementation calls apublic
no-arg constructor on the message class and returns aList
with exactly one packet. -
needsResponse
default boolean needsResponse()Gets whether this login packet needs a response. The default implementation returnstrue
.
-