Package wtf.choco.veinminer.network
Interface ChannelRegistrar
- All Known Implementing Classes:
BukkitChannelHandler
,FabricChannelRegistrar
@OverrideOnly
public interface ChannelRegistrar
Represents a registrar capable of registering incoming and outgoing plugin message
channel handlers.
Some implementations of this registrar may not need to implement message handlers in one of the directions. For instance, while on a Bukkit server both incoming and outgoing message channels must be registered, a Fabric client need not register an outgoing message channel. Implementations of this interface should register (and handle) incoming/outgoing messages and delegate them to the appropriate plugin message listener for messages registered to the supplied registries.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
registerClientboundMessageHandler
(@NotNull NamespacedKey channel, @NotNull PluginMessageRegistry<ClientboundPluginMessageListener> registry) Register a message handler for messages being sent from server to client.void
registerServerboundMessageHandler
(@NotNull NamespacedKey channel, @NotNull PluginMessageRegistry<ServerboundPluginMessageListener> registry) Register a message handler for messages being sent from client to server.
-
Method Details
-
registerClientboundMessageHandler
void registerClientboundMessageHandler(@NotNull @NotNull NamespacedKey channel, @NotNull @NotNull PluginMessageRegistry<ClientboundPluginMessageListener> registry) Register a message handler for messages being sent from server to client.- Parameters:
channel
- the channel on which to register the handlerregistry
- the client bound plugin message registry
-
registerServerboundMessageHandler
void registerServerboundMessageHandler(@NotNull @NotNull NamespacedKey channel, @NotNull @NotNull PluginMessageRegistry<ServerboundPluginMessageListener> registry) Register a message handler for messages being sent from client to server.- Parameters:
channel
- the channel on which to register the handlerregistry
- the server bound plugin message registry
-