Class ServerConfigurationConnectionEvents
java.lang.Object
net.fabricmc.fabric.api.networking.v1.ServerConfigurationConnectionEvents
Offers access to events related to the connection to a client on a logical server while a client is configuring.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Event
<ServerConfigurationConnectionEvents.Configure> Event fired before any vanilla configuration has taken place.static final Event
<ServerConfigurationConnectionEvents.Configure> Event fired during vanilla configuration.static final Event
<ServerConfigurationConnectionEvents.Disconnect> An event for the disconnection of the server configuration network handler. -
Method Summary
-
Field Details
-
BEFORE_CONFIGURE
Event fired before any vanilla configuration has taken place.This event is executed on netty's event loops.
Task queued during this event will complete before vanilla configuration starts.
-
CONFIGURE
Event fired during vanilla configuration.This event is executed on netty's event loops.
An example usage of this:
ServerConfigurationConnectionEvents.CONFIGURE.register((handler, server) -> { if (ServerConfigurationNetworking.canSend(handler, ConfigurationPacket.PACKET_TYPE)) { handler.addTask(new TestConfigurationTask("Example data")); } else { // You can opt to disconnect the client if it cannot handle the configuration task handler.disconnect(Text.literal("Network test configuration not supported by client")); } });
-
DISCONNECT
An event for the disconnection of the server configuration network handler.No packets should be sent when this event is invoked.
-