Interface RegisterChannelEvent
- All Superinterfaces:
Event,LifecycleEvent
Lifecycle event to indicate when network channels should be created and registered.
-
Method Summary
Modifier and TypeMethodDescription<C extends Channel>
Cregister(ResourceKey channelKey, Class<C> channelType) Creates and registers a newChannelfor the given channel key and type.Methods inherited from interface org.spongepowered.api.event.lifecycle.LifecycleEvent
game
-
Method Details
-
register
<C extends Channel> C register(ResourceKey channelKey, Class<C> channelType) throws DuplicateRegistrationException Creates and registers a newChannelfor the given channel key and type.- Parameters:
channelKey- The channel key to register- Returns:
- A new
Channelinstance bound to the channel key - Throws:
DuplicateRegistrationException- The channel key is already in use or reserved
-