fancyholograms-v3: Update to new version config

This commit is contained in:
Oliver
2025-06-27 16:04:12 +02:00
parent f4527487ff
commit 2f15f20309

View File

@@ -13,15 +13,12 @@ public class FHMetrics {
private ExtendedFancyLogger logger; private ExtendedFancyLogger logger;
private FancyAnalyticsAPI fancyAnalytics; private FancyAnalyticsAPI fancyAnalytics;
private boolean isDevelopmentBuild = true;
public FHMetrics() { public FHMetrics() {
logger = FancyHologramsPlugin.get().getFancyLogger(); logger = FancyHologramsPlugin.get().getFancyLogger();
} }
public void register() { public void register() {
isDevelopmentBuild = !FancyHologramsPlugin.get().getVersionConfig().getBuild().equalsIgnoreCase("undefined");
fancyAnalytics = new FancyAnalyticsAPI("3b77bd59-2b01-46f2-b3aa-a9584401797f", "E2gW5zc2ZTk1OGFkNGY2ZDQ0ODlM6San"); fancyAnalytics = new FancyAnalyticsAPI("3b77bd59-2b01-46f2-b3aa-a9584401797f", "E2gW5zc2ZTk1OGFkNGY2ZDQ0ODlM6San");
fancyAnalytics.getConfig().setDisableLogging(true); fancyAnalytics.getConfig().setDisableLogging(true);
@@ -59,7 +56,7 @@ public class FHMetrics {
fancyAnalytics.registerNumberMetric(new MetricSupplier<>("amount_holograms", () -> (double) registry.getAll().size())); fancyAnalytics.registerNumberMetric(new MetricSupplier<>("amount_holograms", () -> (double) registry.getAll().size()));
fancyAnalytics.registerStringMetric(new MetricSupplier<>("enabled_update_notifications", () -> FancyHologramsPlugin.get().getFHConfiguration().areVersionNotificationsMuted() ? "false" : "true")); fancyAnalytics.registerStringMetric(new MetricSupplier<>("enabled_update_notifications", () -> FancyHologramsPlugin.get().getFHConfiguration().areVersionNotificationsMuted() ? "false" : "true"));
fancyAnalytics.registerStringMetric(new MetricSupplier<>("fflag_disable_holograms_for_bedrock_players", () -> FHFeatureFlags.DISABLE_HOLOGRAMS_FOR_BEDROCK_PLAYERS.isEnabled() ? "true" : "false")); fancyAnalytics.registerStringMetric(new MetricSupplier<>("fflag_disable_holograms_for_bedrock_players", () -> FHFeatureFlags.DISABLE_HOLOGRAMS_FOR_BEDROCK_PLAYERS.isEnabled() ? "true" : "false"));
fancyAnalytics.registerStringMetric(new MetricSupplier<>("using_development_build", () -> isDevelopmentBuild ? "true" : "false")); fancyAnalytics.registerStringMetric(new MetricSupplier<>("using_development_build", () -> FancyHologramsPlugin.get().getVersionConfig().isDevelopmentBuild() ? "true" : "false"));
fancyAnalytics.registerStringArrayMetric(new MetricSupplier<>("hologram_type", () -> { fancyAnalytics.registerStringArrayMetric(new MetricSupplier<>("hologram_type", () -> {
if (registry == null) { if (registry == null) {
@@ -79,7 +76,7 @@ public class FHMetrics {
Metrics metrics = new Metrics(FancyHologramsPlugin.get(), 17990); Metrics metrics = new Metrics(FancyHologramsPlugin.get(), 17990);
metrics.addCustomChart(new Metrics.SingleLineChart("total_holograms", () -> FancyHologramsPlugin.get().getRegistry().getAll().size())); metrics.addCustomChart(new Metrics.SingleLineChart("total_holograms", () -> FancyHologramsPlugin.get().getRegistry().getAll().size()));
metrics.addCustomChart(new Metrics.SimplePie("update_notifications", () -> FancyHologramsPlugin.get().getFHConfiguration().areVersionNotificationsMuted() ? "No" : "Yes")); metrics.addCustomChart(new Metrics.SimplePie("update_notifications", () -> FancyHologramsPlugin.get().getFHConfiguration().areVersionNotificationsMuted() ? "No" : "Yes"));
metrics.addCustomChart(new Metrics.SimplePie("using_development_build", () -> isDevelopmentBuild ? "Yes" : "No")); metrics.addCustomChart(new Metrics.SimplePie("using_development_build", () -> FancyHologramsPlugin.get().getVersionConfig().isDevelopmentBuild() ? "Yes" : "No"));
} }
public FancyAnalyticsAPI getFancyAnalytics() { public FancyAnalyticsAPI getFancyAnalytics() {