use of me.lucko.networkinterceptor.NetworkInterceptorCommand in project NetworkInterceptor by SlimeDog.
the class VelocityNetworkInterceptor method onProxyInitialization.
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
// All you have to do is adding the following two lines in your
// onProxyInitialization method.
// You can find the plugin ids of your plugins on the page
// https://bstats.org/what-is-my-plugin-id
// check and enable bStats
this.onEnable();
boolean useMetrics = getConfiguration().getBoolean("enable-metrics", true);
if (useMetrics) {
int pluginId = 12197;
Metrics metrics = metricsFactory.make(this, pluginId);
metrics.addCustomChart(new SimplePie("mode", () -> config.getString("mode", "N/A")));
}
getLogger().info(useMetrics ? "bStats metrics enabled" : "bStats metrics disabled");
CommandManager commandManager = server.getCommandManager();
CommandMeta meta = commandManager.metaBuilder("networkinterceptorvelocity").aliases("niv").build();
commandManager.register(meta, new NetworkInterceptorCommand<>(this).asVelocityCommand());
isStartup = false;
for (RepeatingTaskInfo info : repeatingTasksToSchedule) {
runRepeatingTask(info.runnable, info.ticks);
}
repeatingTasksToSchedule.clear();
}
Aggregations