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