common, fancynpcs, fancyholograms-v2, fancyholograms-v3, ci: Add channel and platform to version config

This commit is contained in:
Oliver
2025-06-27 15:59:29 +02:00
parent a0ef8c264e
commit f4527487ff
11 changed files with 49 additions and 34 deletions

View File

@@ -150,7 +150,9 @@ tasks {
val props = mapOf(
"description" to project.description,
"version" to getFHVersion(),
"hash" to getCurrentCommitHash(),
"commit_hash" to getCurrentCommitHash(),
"channel" to (System.getenv("RELEASE_CHANNEL") ?: "").ifEmpty { "undefined" },
"platform" to (System.getenv("RELEASE_PLATFORM") ?: "").ifEmpty { "undefined" }
)
inputs.properties(props)

View File

@@ -32,7 +32,7 @@ public class FHMetrics {
HologramRegistry registry = FancyHologramsPlugin.get().getRegistry();
fancyAnalytics.registerStringMetric(new MetricSupplier<>("commit_hash", () -> FancyHologramsPlugin.get().getVersionConfig().getHash().substring(0, 7)));
fancyAnalytics.registerStringMetric(new MetricSupplier<>("commit_hash", () -> FancyHologramsPlugin.get().getVersionConfig().getCommitHash().substring(0, 7)));
fancyAnalytics.registerStringMetric(new MetricSupplier<>("server_size", () -> {
long onlinePlayers = Bukkit.getOnlinePlayers().size();

View File

@@ -1,2 +1,4 @@
version: $version
hash: $hash
commit_hash: $commit_hash
platform: $platform
channel: $channel