Skip to content

Commit 2fae639

Browse files
Added CS-CoreLib chart
1 parent 05e401b commit 2fae639

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

src/main/java/dev/walshy/sfmetrics/MetricsModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import dev.walshy.sfmetrics.charts.AddonsChart;
1212
import dev.walshy.sfmetrics.charts.AutoUpdaterChart;
13+
import dev.walshy.sfmetrics.charts.CSCoreLibChart;
1314
import dev.walshy.sfmetrics.charts.CommandChart;
1415
import dev.walshy.sfmetrics.charts.CompatibilityModeChart;
1516
import dev.walshy.sfmetrics.charts.ErrorReportsChart;
@@ -63,6 +64,7 @@ public static void start() {
6364
addChart(metrics, TickRateChart::new);
6465
addChart(metrics, ErrorReportsChart::new);
6566
addChart(metrics, IntegrationsChart::new);
67+
addChart(metrics, CSCoreLibChart::new);
6668

6769
SlimefunPlugin.instance().getLogger().log(Level.INFO, "Now running MetricsModule build #{0}", VERSION);
6870
SlimefunPlugin.instance().getLogger().log(Level.INFO, "with a total of {0}/{1} chart(s)!", new Object[] { enabledCharts, totalCharts });
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package dev.walshy.sfmetrics.charts;
2+
3+
import javax.annotation.Nonnull;
4+
5+
import org.bstats.charts.SimplePie;
6+
import org.bstats.json.JsonObjectBuilder;
7+
import org.bukkit.Bukkit;
8+
9+
import dev.walshy.sfmetrics.SlimefunMetricsChart;
10+
11+
public class CSCoreLibChart extends SimplePie implements SlimefunMetricsChart {
12+
13+
public CSCoreLibChart() {
14+
super("cs-corelib_installed", () -> {
15+
boolean isCSCoreLibInstalled = Bukkit.getPluginManager().isPluginEnabled("CS-CoreLib");
16+
return isCSCoreLibInstalled ? "Yes" : "No";
17+
});
18+
}
19+
20+
@Nonnull
21+
@Override
22+
public String getName() {
23+
return "Is CS-CoreLib installed?";
24+
}
25+
26+
@Nonnull
27+
@Override
28+
public JsonObjectBuilder.JsonObject getDataSample() throws Exception {
29+
return getChartData();
30+
}
31+
32+
}

src/main/java/dev/walshy/sfmetrics/charts/ResourcePackChart.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ public ResourcePackChart() {
2424

2525
if (version != null && version.startsWith("v")) {
2626
return version + " (Official)";
27-
}
28-
else if (SlimefunPlugin.getItemTextureService().isActive()) {
27+
} else if (SlimefunPlugin.getItemTextureService().isActive()) {
2928
return "Custom / Modified";
30-
}
31-
else {
29+
} else {
3230
return "None";
3331
}
3432
});

0 commit comments

Comments
 (0)