diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f2c12b14..db1bf205 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,9 @@ [versions] +bstats-bukkit = "3.0.2" paper-api = "1.20.4-R0.1-SNAPSHOT" worldedit = "7.2.9" [libraries] +bstats-bukkit = { group = "org.bstats", name = "bstats-bukkit", version.ref = "bstats-bukkit" } paper-api = { group = "io.papermc.paper", name = "paper-api", version.ref = "paper-api" } worldedit = { group = "com.sk89q.worldedit", name = "worldedit-bukkit", version.ref = "worldedit" } \ No newline at end of file diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index a0cde31e..eec8d15a 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id("maven-publish") id("xyz.jpenilla.run-paper") version "2.3.0" id("com.modrinth.minotaur") version "2.+" + id("com.github.johnrengelman.shadow") version "8.1.1" } val supportedVersions = listOf("1.19.4", "1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4", "1.20.5", "1.20.6", "1.21") @@ -11,6 +12,7 @@ repositories { } dependencies { + implementation(libs.bstats.bukkit) compileOnlyApi(libs.paper.api) compileOnly(libs.worldedit) } @@ -33,16 +35,21 @@ tasks { } jar { + archiveClassifier.set("unshaded") + } + + shadowJar { from("src/main/java/resources") { include("*") } + relocate("org.bstats", "org.battlearena.arena.shaded.bstats") + archiveFileName.set("BattleArena.jar") - archiveClassifier.set("") } create("bundledJar") { - dependsOn(jar) + dependsOn(shadowJar) from(sourceSets.main.get().output) // Bundle in our modules diff --git a/plugin/src/main/java/org/battleplugins/arena/BattleArena.java b/plugin/src/main/java/org/battleplugins/arena/BattleArena.java index fdb16b6a..fd6fb815 100644 --- a/plugin/src/main/java/org/battleplugins/arena/BattleArena.java +++ b/plugin/src/main/java/org/battleplugins/arena/BattleArena.java @@ -28,6 +28,7 @@ import org.battleplugins.arena.util.LoggerHolder; import org.battleplugins.arena.util.Util; import org.battleplugins.arena.util.Version; +import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.command.PluginCommand; import org.bukkit.configuration.Configuration; @@ -63,6 +64,8 @@ * The main class for BattleArena. */ public class BattleArena extends JavaPlugin implements Listener, LoggerHolder { + private static final int PLUGIN_ID = 4597; + private static BattleArena instance; final Map arenaTypes = new HashMap<>(); @@ -117,6 +120,8 @@ public void onEnable() { // Loads all arena loaders this.loadArenaLoaders(this.arenasPath); + + new Metrics(this, PLUGIN_ID); } private void enable() {