Skip to content

Economy Warehouse Bridge (plugin)

Records every money movement on the server into a MariaDB "warehouse", with the reason it happened, so staff can audit the economy and build dashboards. Also keeps daily balance snapshots.

What it does

  • Writes one row per balance change to economy_events: who, how much, the new balance, and a source type (shop sale, vote reward, admin grant, Pixelmon battle, and so on).
  • Takes the raw change from XConomy, the server's economy plugin, and matches it to a reason from: EconomyShopGUI, QuickShop-Hikari (purchases and creation fees), VotingPlugin, its own commands, and Pixelmon (through the Economy Warehouse Bridge mod).
  • Saves a balance snapshot for every player once a day, and keeps a current-balance table.
  • Can compare its row count with XConomy's own record table and alert when they drift apart.

All the hooks are optional. A plugin that is not installed is simply skipped.

How players use it

Players do not interact with this plugin.

Staff guide

Everything needs economywarehouse.admin (ops by default). Console works.

Task Command
Check hooks, queue size and collector /economywarehouse status
Reload the config /economywarehouse reload
Take a balance snapshot now /economywarehouse snapshot
Run a reconciliation check now /economywarehouse reconcile
Give or take money, labelled as an admin action /economywarehouse give\|take <player> <amount> [detail]
Give or take money with your own label /economywarehouse award\|charge <player> <amount> <source_type> [detail]
Label the next payment, without moving money /economywarehouse tag <player> <amount> <source_type> [detail]

Source types are lowercase letters, digits and underscores, up to 64 characters.

Labelling payouts from other plugins. When a plugin pays by console command and cannot be hooked, put a tag line right before the real payout:

economywarehouse tag %player% 1500 bingo_full_card
eco give %player% 1500

Prefer tag over award. If this plugin is ever broken, tag fails but the player is still paid. award would stop the payout. Use award only where the label must be exact even if payment is delayed, for example VotingPlugin rewards that run when the player next logs in:

economywarehouse award %player% 100 vote_reward Minecraft-MP

Configuration

plugins/EconomyWarehouseBridge/config.yml. /economywarehouse reload re-reads it.

Section What it is for
server-name This server's name, saved on every row
database The warehouse MariaDB login and pool size
collector The local HTTP endpoint the mod sends Pixelmon tags to. shared-secret must match the mod's sharedSecret. Keep host on 127.0.0.1
attribution.ttl-seconds How long a reason waits to be matched to a balance change
hooks Turn each integration on or off
snapshots Daily balance snapshots (interval-minutes: 1440)
reconciliation Optional drift check against XConomy's record table (read-only login)

On main, keep hooks.xconomy: true. hooks.vault-wrapper is off on main, because XConomy's own event is the raw source of truth. hooks.essentials only mattered during the move from EssentialsX to XConomy.

Data and storage

MariaDB, in the database from database.url:

Table Holds
economy_events Every balance change with its source type and detail
balance_snapshots Periodic balance of every player
balance_latest Each player's most recent balance

Rows are only ever added. The dashboards read these tables, so do not delete or edit rows.

Troubleshooting

Symptom Cause Fix
Rows show as unattributed The paying plugin is not hooked, or no tag was sent first Add a tag line before the payout command
Pixelmon money is unattributed The mod is missing or its secret does not match Check /economywarehouse status and the mod's bridge.json
Reconciliation alerts Warehouse and XConomy row counts differ Look for errors writing to the database around the alert time
No Vault economy provider is registered. XConomy or Vault not loaded Fix the economy plugin first

Maintainer notes

  • Optional integrations are loaded by reflection. The plugin compiles only against the Spigot API and the Vault API jar.
  • Third-party event handler lists are shared on Youer, so hooks filter by the exact event class. Without that, the boot logged bridge warnings.
  • Shop and QuickShop success events are matched back to their raw XConomy movement. Only high-confidence pending reasons are used.
  • award and charge create the reason microseconds before the Vault call, so the label is exact however late the payout runs.
  • HikariCP and the MariaDB driver are shaded into the jar. 20 unit tests.

Building

"../HubCompass/gradlew" -p . build

This folder has no Gradle wrapper of its own. Java 21. Output: build/libs/EconomyWarehouseBridge-<version>.jar. The Vault API comes from ../../Mods/gts/test-server/plugins/Vault.jar.

Full command, permission and config tables: Reference.