use of com.alessiodp.core.velocity.bootstrap.ADPVelocityBootstrap in project ADP-Core by AlessioDP.
the class VelocityCommandUtils method register.
@Override
@NotNull
public RegisterResult register(@NotNull ADPMainCommand command) {
RegisterResult ret = RegisterResult.FAILED;
try {
ADPVelocityBootstrap velocityPlugin = (ADPVelocityBootstrap) plugin.getBootstrap();
VelocityCommandImpl velocityCommandImplementation = new VelocityCommandImpl(plugin, command);
CommandMeta meta = velocityPlugin.getServer().getCommandManager().metaBuilder(command.getCommandName()).aliases(command.getAliases().toArray(new String[0])).build();
velocityPlugin.getServer().getCommandManager().register(meta, velocityCommandImplementation);
ret = RegisterResult.SUCCESSFUL;
plugin.getLoggerManager().logDebug(String.format(Constants.DEBUG_CMD_SETUP_REGISTER_MAINCOMMAND, CommonUtils.toLowerCase(command.getCommandName()), CommonUtils.toLowerCase(ret.name())), true);
} catch (Exception ex) {
plugin.getLoggerManager().logError(Constants.DEBUG_CMD_SETUP_REGISTER_FAILED, ex);
}
return ret;
}
use of com.alessiodp.core.velocity.bootstrap.ADPVelocityBootstrap in project ADP-Core by AlessioDP.
the class VelocityBungeecordListener method registerChannel.
@Override
public void registerChannel(@NotNull MessageChannel channel) {
ChannelIdentifier identifier = MinecraftChannelIdentifier.create(plugin.getPluginFallbackName(), channel.getId());
((ADPVelocityBootstrap) plugin.getBootstrap()).getServer().getChannelRegistrar().register(identifier);
getChannels().put(channel, identifier);
}
use of com.alessiodp.core.velocity.bootstrap.ADPVelocityBootstrap in project ADP-Core by AlessioDP.
the class VelocityBungeecordDispatcher method registerChannel.
@Override
public void registerChannel(@NotNull MessageChannel channel) {
ChannelIdentifier identifier = MinecraftChannelIdentifier.create(plugin.getPluginFallbackName(), channel.getId());
((ADPVelocityBootstrap) plugin.getBootstrap()).getServer().getChannelRegistrar().register(identifier);
getChannels().put(channel, identifier);
}
use of com.alessiodp.core.velocity.bootstrap.ADPVelocityBootstrap in project ADP-Core by AlessioDP.
the class ADPVelocityScheduler method scheduleAsyncRepeating.
@Override
public CancellableTask scheduleAsyncRepeating(@NotNull Runnable runnable, long delay, long period, TimeUnit unit) {
ADPVelocityBootstrap velocityPlugin = ((ADPVelocityBootstrap) plugin.getBootstrap());
// Use Velocity scheduler instead of mine
ScheduledTask future = velocityPlugin.getServer().getScheduler().buildTask(velocityPlugin, runnable).delay(delay, unit).repeat(period, unit).schedule();
return future::cancel;
}
use of com.alessiodp.core.velocity.bootstrap.ADPVelocityBootstrap in project ADP-Core by AlessioDP.
the class ADPVelocityScheduler method scheduleAsyncLater.
@Override
public CancellableTask scheduleAsyncLater(@NotNull Runnable runnable, long delay, TimeUnit unit) {
ADPVelocityBootstrap velocityPlugin = ((ADPVelocityBootstrap) plugin.getBootstrap());
// Use Velocity scheduler instead of mine
ScheduledTask future = velocityPlugin.getServer().getScheduler().buildTask(velocityPlugin, runnable).delay(delay, unit).schedule();
return future::cancel;
}
Aggregations