Skip to content

Commit

Permalink
add bstat
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorax5 committed Aug 15, 2024
1 parent 1293808 commit ff841bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {

implementation 'cz.advel.jbullet:jbullet:20101010-1'
implementation "co.aikar:acf-paper:0.5.1-SNAPSHOT"
implementation "org.bstats:bstats-bukkit:3.0.2"
}

def targetJavaVersion = 21
Expand Down Expand Up @@ -66,6 +67,7 @@ shadowJar {

relocate 'co.aikar.commands', 'fr.phylisiumstudio.acf'
relocate 'co.aikar.locales', 'fr.phylisiumstudio.locales'
relocate 'org.bstats', 'fr.phylisiumstudio.bstats'
}

build.dependsOn shadowJar
9 changes: 9 additions & 0 deletions src/main/java/fr/phylisiumstudio/soraxPhysic/SoraxPhysic.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import fr.phylisiumstudio.soraxPhysic.commands.PhysicsCommands;
import fr.phylisiumstudio.soraxPhysic.listeners.RigidbodyListener;
import fr.phylisiumstudio.soraxPhysic.listeners.ToolsListener;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.plugin.java.JavaPlugin;
Expand Down Expand Up @@ -38,6 +40,13 @@ public void onDisable() {
this.physicsManager.stop();
}

private void setupBstats(){
int pluginId = 23021;
Metrics metrics = new Metrics(this, pluginId);
metrics.addCustomChart(new SimplePie("used_worldedit_version", WorldEdit::getVersion));
metrics.addCustomChart(new SimplePie("used_physics_version", () -> this.getPluginMeta().getVersion()));
}

private void setupCommands(){
commandManager = new PaperCommandManager(this);
commandManager.enableUnstableAPI("help");
Expand Down

0 comments on commit ff841bd

Please sign in to comment.