Skip to content

LiveMarket 0.6.0

Latest

Choose a tag to compare

@rconpilot rconpilot released this 28 Nov 17:09
5e8ba54

LiveMarket 0.6.0

Player trade history — every successful trade is recorded, and players can look back at their own trading with /market history.

What's new

  • /market history [item] [page] — your past trades, newest first, 8 per page: date/time, side (BOUGHT/SOLD), amount, item, unit price and total (sell totals are after the fee). Filter by item (/market history WHEAT), page through them (/market history 2).
  • Every successful trade is recorded — buys and sells, from the command and from the GUI. Failed trades (not enough money, not enough items, full inventory, paused market) record nothing.
  • Persists in both backends — history lives in data.yml under trade-history on the YAML backend, and in the new lm_trades table on MySQL (included in the one-time migration from data.yml, so switching backends keeps your trades). The last settings.trade-history-entries trades per player are kept (default 100).
  • Message keys merge on upgrade — upgrading servers keep their existing messages.yml, so new message keys are now added to it automatically on enable (existing edits are never overwritten).

Verified

End-to-end on Paper 1.21.11 with Vault, EssentialsX and PlaceholderAPI, using a bot player and the built-in debug mode:

  • YAML: 11 trades recorded with exact amounts and totals (buy 64 WHEAT @ 7.7661 = 497.03; sell 32 WHEAT @ 8 = 243.20; buy 4 DIAMOND @ 120.95 = 483.80); history list newest-first, item filter, pagination (8 per page), out-of-range page and unknown item handled; a failed trade leaves no record. All 11 trades survive a restart.
  • MySQL: migration copies all 11 trades into lm_trades with exact values; 11 more trades on MySQL land in the table (22 rows total); a restart restores all 22 from the database, oldest first-trade included.
  • Upgrading from a 0.5.0 messages.yml: the new history-* keys are merged in on enable (this was caught by testing — before the fix the history lines rendered as raw key names).
  • One environment quirk, not a plugin bug: on this VM Java's default dual-stack networking garbles the MySQL handshake (the sandbox IPv6 mesh), so the test server is launched with -Djava.net.preferIPv4Stack=true; ordinary servers don't need it.

Install

Drop LiveMarket-0.6.0.jar into your server's plugins/ folder and restart. Requires Paper 1.21.x, Vault, and any Vault economy plugin (e.g. EssentialsX). PlaceholderAPI is optional. Existing config.yml / data.yml from 0.5.0 keep working.