fix bstats

This commit is contained in:
Minecon724 2024-09-22 14:40:31 +02:00
parent 1b8fc3312a
commit 2bfddbee0d
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
2 changed files with 13 additions and 8 deletions

View file

@ -40,11 +40,6 @@
<artifactId>jarupdater</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>eu.m724</groupId>
<artifactId>jarupdater</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
@ -84,14 +79,14 @@
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<!-- Replace this with your package! -->
<shadedPattern>eu.m724.realweather</shadedPattern>
<shadedPattern>eu.m724.realweather.bstats</shadedPattern>
</relocation>
</relocations>
<artifactSet>
<includes>
<include>eu.m724:wtapi</include>
<include>eu.m724:jarupdater</include>
<include>org.bstats:*</include>
<!-- <include>org.java-websocket:Java-WebSocket</include> -->
</includes>
</artifactSet>

View file

@ -7,6 +7,7 @@ import java.io.InputStreamReader;
import java.util.logging.Logger;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
@ -140,7 +141,16 @@ public class RealWeatherPlugin extends JavaPlugin {
if (GlobalConstants.weatherConfig.enabled)
getCommand("localweather").setExecutor(new LocalWeatherCommand());
new Metrics(this, 15020);
Metrics metrics = new Metrics(this, 15020);
metrics.addCustomChart(new SimplePie("weather_provider", () ->
GlobalConstants.weatherConfig.enabled ? GlobalConstants.weatherConfig.provider : "off"
));
metrics.addCustomChart(new SimplePie("thunder_provider", () ->
GlobalConstants.thunderConfig.enabled ? GlobalConstants.thunderConfig.provider : "off"
));
metrics.addCustomChart(new SimplePie("real_time", () ->
GlobalConstants.timeConfig.enabled ? "on" : "off"
));
DebugLogger.info("ended loading", 1);
}