Search in sources :

Example 1 with VelocityCloudCommand

use of de.polocloud.plugin.bootstrap.velocity.commands.VelocityCloudCommand in project PoloCloud by PoloServices.

the class VelocityBootstrap method handle.

@Subscribe
public void handle(final ProxyInitializeEvent event) {
    new VelocityCloudListener(this.proxyServer);
    this.proxyServer.getEventManager().register(this, new VelocityListener(this, this.proxyServer));
    CommandMeta meta = this.proxyServer.getCommandManager().metaBuilder("cloud").build();
    this.proxyServer.getCommandManager().register(meta, new VelocityCloudCommand());
    // update that the service is ready to use
    final var service = Wrapper.getInstance().thisService();
    if (service.getGroup().isAutoUpdating()) {
        service.edit(cloudService -> cloudService.setState(ServiceState.ONLINE));
    }
}
Also used : VelocityCloudListener(de.polocloud.plugin.bootstrap.velocity.listener.VelocityCloudListener) VelocityListener(de.polocloud.plugin.bootstrap.velocity.listener.VelocityListener) VelocityCloudCommand(de.polocloud.plugin.bootstrap.velocity.commands.VelocityCloudCommand) CommandMeta(com.velocitypowered.api.command.CommandMeta) Subscribe(com.velocitypowered.api.event.Subscribe)

Aggregations

CommandMeta (com.velocitypowered.api.command.CommandMeta)1 Subscribe (com.velocitypowered.api.event.Subscribe)1 VelocityCloudCommand (de.polocloud.plugin.bootstrap.velocity.commands.VelocityCloudCommand)1 VelocityCloudListener (de.polocloud.plugin.bootstrap.velocity.listener.VelocityCloudListener)1 VelocityListener (de.polocloud.plugin.bootstrap.velocity.listener.VelocityListener)1