Interface ServerConfigurationNetworking.ConfigurationPacketHandler<T extends FabricPacket>
- Type Parameters:
T
- the type of the packet
- Enclosing class:
ServerConfigurationNetworking
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface ServerConfigurationNetworking.ConfigurationPacketHandler<T extends FabricPacket>
A thread-safe packet handler utilizing
FabricPacket
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
receive
(T packet, ServerConfigurationNetworkHandler networkHandler, PacketSender responseSender) Handles an incoming packet.
-
Method Details
-
receive
void receive(T packet, ServerConfigurationNetworkHandler networkHandler, PacketSender responseSender) Handles an incoming packet.Unlike
ServerPlayNetworking.PlayPacketHandler
this method is executed on netty's event loops. Modification to the game should be scheduled using the Minecraft server instance fromServerConfigurationNetworking.getServer(ServerConfigurationNetworkHandler)
.An example usage of this:
// See FabricPacket for creating the packet ServerConfigurationNetworking.registerReceiver(BOOM_PACKET_TYPE, (packet, responseSender) -> { });
- Parameters:
packet
- the packetnetworkHandler
- the network handlerresponseSender
- the packet sender- See Also:
-