Class ServerConfigurationNetworkAddon
java.lang.Object
net.fabricmc.fabric.impl.networking.AbstractNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
net.fabricmc.fabric.impl.networking.AbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
net.fabricmc.fabric.impl.networking.server.ServerConfigurationNetworkAddon
- All Implemented Interfaces:
PacketSender, CommonPacketHandler
public final class ServerConfigurationNetworkAddon
extends AbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
Field Summary
Fields inherited from class AbstractChanneledNetworkAddon
commonVersion, connection, receiver, sendableChannelsFields inherited from class AbstractNetworkAddon
logger -
Constructor Summary
ConstructorsConstructorDescriptionServerConfigurationNetworkAddon(net.minecraft.server.network.ServerConfigurationPacketListenerImpl listener, net.minecraft.server.MinecraftServer server) -
Method Summary
Modifier and TypeMethodDescriptionvoidnet.minecraft.network.protocol.Packet<?> createPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload packet) Creates a packet from a packet payload.@Nullable Stringbooleanhandle(net.minecraft.network.protocol.common.custom.CustomPacketPayload payload) protected voidhandleRegistration(net.minecraft.resources.Identifier channelName) protected voidhandleUnregistration(net.minecraft.resources.Identifier channelName) protected voidprotected voidprotected voidinvokeRegisterEvent(List<net.minecraft.resources.Identifier> ids) protected voidinvokeUnregisterEvent(List<net.minecraft.resources.Identifier> ids) protected booleanbooleanprotected booleanisReservedChannel(net.minecraft.resources.Identifier channelName) Checks if a channel is considered a "reserved" channel.voidonPong(int parameter) voidprotected voidreceive(ServerConfigurationNetworking.ConfigurationPacketHandler<?> listener, net.minecraft.network.protocol.common.custom.CustomPacketPayload payload) protected voidreceiveRegistration(boolean register, RegistrationPayload resolvable) protected voidSchedules a task to run on the main thread.voidsendPacket(net.minecraft.network.protocol.Packet<?> packet, io.netty.channel.ChannelFutureListener callback) Sends a packet.voidbooleanMethods inherited from class AbstractChanneledNetworkAddon
createRegisterPayload, createRegistrationPayload, disconnect, getNegotiatedVersion, getSendableChannels, onCommonRegisterPacket, onCommonVersionPacket, registerPendingChannels, sendInitialChannelRegistrationPacketMethods inherited from class AbstractNetworkAddon
endSession, getHandler, getReceivableChannels, handleDisconnect, lateInit, registerChannel, registerChannels, unregisterChannelMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PacketSender
sendPacket, sendPacket, sendPacket
-
Constructor Details
-
ServerConfigurationNetworkAddon
public ServerConfigurationNetworkAddon(net.minecraft.server.network.ServerConfigurationPacketListenerImpl listener, net.minecraft.server.MinecraftServer server)
-
-
Method Details
-
handle
public boolean handle(net.minecraft.network.protocol.common.custom.CustomPacketPayload payload) - Overrides:
handlein classAbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
isOnReceiveThread
protected boolean isOnReceiveThread()- Specified by:
isOnReceiveThreadin classAbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
invokeInitEvent
protected void invokeInitEvent()- Specified by:
invokeInitEventin classAbstractNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
preConfiguration
public void preConfiguration() -
configuration
public void configuration() -
startConfiguration
public boolean startConfiguration() -
receiveRegistration
- Overrides:
receiveRegistrationin classAbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
onPong
public void onPong(int parameter) -
receive
protected void receive(ServerConfigurationNetworking.ConfigurationPacketHandler<?> listener, net.minecraft.network.protocol.common.custom.CustomPacketPayload payload) - Specified by:
receivein classAbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
schedule
Description copied from class:AbstractChanneledNetworkAddonSchedules a task to run on the main thread.- Specified by:
schedulein classAbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
createPacket
public net.minecraft.network.protocol.Packet<?> createPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload packet) Description copied from interface:PacketSenderCreates a packet from a packet payload.- Parameters:
packet- the packet payload
-
invokeRegisterEvent
- Specified by:
invokeRegisterEventin classAbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
invokeUnregisterEvent
- Specified by:
invokeUnregisterEventin classAbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
handleRegistration
protected void handleRegistration(net.minecraft.resources.Identifier channelName) - Specified by:
handleRegistrationin classAbstractNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
handleUnregistration
protected void handleUnregistration(net.minecraft.resources.Identifier channelName) - Specified by:
handleUnregistrationin classAbstractNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
invokeDisconnectEvent
protected void invokeDisconnectEvent()- Specified by:
invokeDisconnectEventin classAbstractNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>
-
isReservedChannel
protected boolean isReservedChannel(net.minecraft.resources.Identifier channelName) Description copied from class:AbstractNetworkAddonChecks if a channel is considered a "reserved" channel. A reserved channel such as "minecraft:(un)register" has special handling and should not have any channel handlers registered for it.- Specified by:
isReservedChannelin classAbstractNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>- Parameters:
channelName- the channel name- Returns:
- whether the channel is reserved
-
sendPacket
public void sendPacket(net.minecraft.network.protocol.Packet<?> packet, io.netty.channel.ChannelFutureListener callback) Description copied from interface:PacketSenderSends a packet.- Specified by:
sendPacketin interfacePacketSender- Overrides:
sendPacketin classAbstractChanneledNetworkAddon<ServerConfigurationNetworking.ConfigurationPacketHandler<?>>- Parameters:
packet- the packetcallback- an optional callback to execute after the packet is sent, may benull.
-
getClientBrand
-
isReconfiguring
public boolean isReconfiguring() -
setReconfiguring
public void setReconfiguring() -
getChannelInfoHolder
-