Skip to content

Commit

Permalink
Add bStats metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Redned235 committed Jul 13, 2024
1 parent 61f6558 commit 6561ca9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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" }
11 changes: 9 additions & 2 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -11,6 +12,7 @@ repositories {
}

dependencies {
implementation(libs.bstats.bukkit)
compileOnlyApi(libs.paper.api)
compileOnly(libs.worldedit)
}
Expand All @@ -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<Jar>("bundledJar") {
dependsOn(jar)
dependsOn(shadowJar)
from(sourceSets.main.get().output)

// Bundle in our modules
Expand Down
5 changes: 5 additions & 0 deletions plugin/src/main/java/org/battleplugins/arena/BattleArena.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, ArenaType> arenaTypes = new HashMap<>();
Expand Down Expand Up @@ -117,6 +120,8 @@ public void onEnable() {

// Loads all arena loaders
this.loadArenaLoaders(this.arenasPath);

new Metrics(this, PLUGIN_ID);
}

private void enable() {
Expand Down

0 comments on commit 6561ca9

Please sign in to comment.