Skip to content

feat: BStats Metrics#517

Merged
Exanthiax merged 3 commits into
masterfrom
feat/bstats
May 16, 2026
Merged

feat: BStats Metrics#517
Exanthiax merged 3 commits into
masterfrom
feat/bstats

Conversation

@CallumJohnson

Copy link
Copy Markdown
Contributor

bStats Custom Metrics

What changed

New API — EcoMetricsChart (eco-api)
Sealed Kotlin class exposing all bStats chart types as a clean, type-safe API. Supports SimplePie, AdvancedPie, DrilldownPie, SingleLineChart, MultiLineChart, SimpleBarChart, and AdvancedBarChart. Companion object provides @JvmStatic factory methods for Java compatibility.

EcoPlugin.getCustomCharts()
New opt-in method returning List. Returns empty list by default — zero breakage for existing plugins. Override to declare custom bStats charts submitted alongside standard metrics.

bStats vendoring via Gradle
Replaced the hand-rolled vendored Metrics.kt with a vendorBStats Gradle task that clones the official bStats-Metrics repo at a pinned tag (v3.2.1), relocates all sources from org.bstats → com.willfp.eco.libs.bstats, and prepends attribution headers. Output lands in build/generated/sources/bstats/ (not committed). Task is cached by version... re-runs only when bStatsVersion changes (or gradle clean). Solves a classpath conflict where MythicMobs bundles an unrelocated old bStats, which previously caused compile-time resolution to the wrong Metrics class.

Eco-specific charts (EcoImpl)
Eco now submits its own charts:

  • data_handler — storage backend in use (yaml / mysql / mariadb / mongodb)
  • loaded_eco_plugins — count of distinct loaded Eco-based plugins
  • loaded_extensions — total extensions loaded across all Eco plugins
  • antigrief_integrations — active antigrief plugins (AdvancedPie, share + count)
  • custom_item_integrations — active custom item plugins (AdvancedPie)
  • anticheat_integrations — active anticheat plugins (AdvancedPie)

getRegisteredIntegrations() added to AntigriefManager, AnticheatManager, CustomItemsManager
Mirrors the existing pattern from ShopManager. Used by the Eco metrics charts above.

@Exanthiax Exanthiax merged commit 1b358d8 into master May 16, 2026
1 check passed
@Exanthiax Exanthiax deleted the feat/bstats branch May 16, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants