Skip to content

Commit dfcdefc

Browse files
committed
feat: bstats metrics
1 parent 2797028 commit dfcdefc

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ dependencies {
2222

2323
// Plugin dependencies
2424
compileOnly(libs.miniplaceholders)
25+
26+
implementation(libs.bstats)
2527
}
2628

2729
tasks {
@@ -47,6 +49,7 @@ tasks {
4749
}
4850
shadowJar {
4951
archiveClassifier.set("")
52+
relocate("org.bstats", "de.rexlmanu.fairychat.dependencies.bstats")
5053
from(file("LICENSE"))
5154

5255
dependencies {

gradle/libs.versions.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ miniplaceholders = { module = "io.github.miniplaceholders:miniplaceholders-api",
1212
commandframework = { module = "cloud.commandframework:cloud-paper", version = "1.8.3" }
1313
configlib = { module = "com.github.Exlll.ConfigLib:configlib-paper", version = "v4.2.0" }
1414
guice = { module = "com.google.inject:guice", version = "7.0.0" }
15-
luckperms = { module = "net.luckperms:api", version = "5.4" }
15+
luckperms = { module = "net.luckperms:api", version = "5.4" }
16+
bstats = { module = "org.bstats:bstats-bukkit", version = "3.0.2" }

src/main/java/de/rexlmanu/fairychat/plugin/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ private Constants() {
1313

1414
public static final String MESSAGING_CHANNEL = "fairychat:messaging";
1515
public static final String BROADCAST_CHANNEL = "fairychat:broadcast";
16+
17+
public static final int BSTATS_ID = 18786;
1618
}

src/main/java/de/rexlmanu/fairychat/plugin/FairyChatPlugin.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import de.rexlmanu.fairychat.plugin.module.PermissionModule;
1111
import de.rexlmanu.fairychat.plugin.module.PluginModule;
1212
import de.rexlmanu.fairychat.plugin.redis.RedisConnector;
13+
import org.bstats.bukkit.Metrics;
1314
import org.bukkit.plugin.java.JavaPlugin;
1415

1516
public class FairyChatPlugin extends JavaPlugin {
@@ -34,6 +35,8 @@ public void onEnable() {
3435
.registerEvents(this.injector.getInstance(ChatListener.class), this);
3536

3637
this.registerCommands();
38+
39+
new Metrics(this, Constants.BSTATS_ID);
3740
}
3841

3942
@Override

0 commit comments

Comments
 (0)