Search in sources :

Example 1 with RawDataChannel

use of org.spongepowered.api.network.ChannelBinding.RawDataChannel in project ChangeSkin by games647.

the class ChangeSkinSponge method onInit.

@Listener
public void onInit(GameInitializationEvent initEvent) {
    if (!initialized)
        return;
    CommandManager cmdManager = Sponge.getCommandManager();
    // command and event register
    cmdManager.register(this, injector.getInstance(SelectCommand.class).buildSpec(), "skin-select", "skinselect");
    cmdManager.register(this, injector.getInstance(InfoCommand.class).buildSpec(), "skin-info");
    cmdManager.register(this, injector.getInstance(UploadCommand.class).buildSpec(), "skin-upload");
    cmdManager.register(this, injector.getInstance(SetCommand.class).buildSpec(), "changeskin", "setskin", "skin");
    cmdManager.register(this, injector.getInstance(InvalidateCommand.class).buildSpec(), "skininvalidate", "skin-invalidate");
    Sponge.getEventManager().registerListeners(this, injector.getInstance(LoginListener.class));
    RawDataChannel pluginChannel = Sponge.getChannelRegistrar().createRawChannel(this, PomData.ARTIFACT_ID);
    pluginChannel.addListener(injector.getInstance(BungeeListener.class));
}
Also used : CommandManager(org.spongepowered.api.command.CommandManager) RawDataChannel(org.spongepowered.api.network.ChannelBinding.RawDataChannel) Listener(org.spongepowered.api.event.Listener)

Aggregations

CommandManager (org.spongepowered.api.command.CommandManager)1 Listener (org.spongepowered.api.event.Listener)1 RawDataChannel (org.spongepowered.api.network.ChannelBinding.RawDataChannel)1