mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
setup velocity bstats
This commit is contained in:
4 files changed
+19
-4
No files matched your search
@@ -23,7 +23,7 @@ versions:
|
||||
stylecheck: 0.1
|
||||
gson: 2.10
|
||||
guava: 30.1-jre
|
||||
bstats: 3.0.0
|
||||
bstats: 3.0.2
|
||||
paperApi: 1.19.4-R0.1-SNAPSHOT
|
||||
paperTrail: 0.0.1-SNAPSHOT
|
||||
foliaApi: 1.19.4-R0.1-SNAPSHOT
|
||||
@@ -184,6 +184,10 @@ dependencies:
|
||||
group: org.bstats
|
||||
name: bstats-bukkit
|
||||
version: { ref: bstats }
|
||||
bstatsVelocity:
|
||||
group: org.bstats
|
||||
name: bstats-velocity
|
||||
version: { ref: bstats }
|
||||
bstatsSponge:
|
||||
group: org.bstats
|
||||
name: bstats-sponge
|
||||
|
||||
@@ -96,8 +96,6 @@ public final class CarbonChatPaper extends CarbonChatInternal {
|
||||
}
|
||||
|
||||
void onEnable() {
|
||||
final Metrics metrics = new Metrics(this.plugin, BSTATS_PLUGIN_ID);
|
||||
|
||||
this.init();
|
||||
this.packetService();
|
||||
|
||||
@@ -109,6 +107,9 @@ public final class CarbonChatPaper extends CarbonChatInternal {
|
||||
}
|
||||
|
||||
this.discoverDiscordHooks();
|
||||
|
||||
final Metrics metrics = new Metrics(this.plugin, BSTATS_PLUGIN_ID);
|
||||
// metrics.addCustomChart(new SimplePie("user_manager_type", () -> this.injector().getInstance(ConfigFactory.class).primaryConfig().storageType().name()));
|
||||
}
|
||||
|
||||
private void discoverDiscordHooks() {
|
||||
|
||||
@@ -5,6 +5,7 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
implementation(projects.carbonchatCommon)
|
||||
implementation(libs.bstatsVelocity)
|
||||
|
||||
compileOnly(libs.velocityApi)
|
||||
|
||||
|
||||
@@ -29,14 +29,18 @@ import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import java.nio.file.Path;
|
||||
import net.draycia.carbon.common.util.CarbonDependencies;
|
||||
import org.bstats.velocity.Metrics;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
public final class CarbonVelocityBootstrap {
|
||||
|
||||
private static final int BSTATS_PLUGIN_ID = 19505;
|
||||
|
||||
private final Injector parentInjector;
|
||||
private final PluginContainer pluginContainer;
|
||||
private final ProxyServer proxy;
|
||||
private final Path dataDirectory;
|
||||
private final Metrics.Factory metricsFactory;
|
||||
private @MonotonicNonNull Injector injector;
|
||||
|
||||
@Inject
|
||||
@@ -44,12 +48,14 @@ public final class CarbonVelocityBootstrap {
|
||||
final Injector injector,
|
||||
final ProxyServer proxyServer,
|
||||
final PluginContainer pluginContainer,
|
||||
@DataDirectory final Path dataDirectory
|
||||
@DataDirectory final Path dataDirectory,
|
||||
final Metrics.Factory metricsFactory
|
||||
) {
|
||||
this.proxy = proxyServer;
|
||||
this.parentInjector = injector;
|
||||
this.pluginContainer = pluginContainer;
|
||||
this.dataDirectory = dataDirectory;
|
||||
this.metricsFactory = metricsFactory;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -62,6 +68,9 @@ public final class CarbonVelocityBootstrap {
|
||||
this.injector = this.parentInjector.createChildInjector(
|
||||
new CarbonChatVelocityModule(this.pluginContainer, this.proxy, this.dataDirectory));
|
||||
this.injector.getInstance(CarbonChatVelocity.class).onInitialization(this);
|
||||
|
||||
final Metrics metrics = this.metricsFactory.make(this, BSTATS_PLUGIN_ID);
|
||||
// metrics.addCustomChart(new SimplePie("user_manager_type", () -> this.injector.getInstance(ConfigFactory.class).primaryConfig().storageType().name()));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
Reference in new issue
Block a user