GrzybcioRynek

market-data.yml

Favorites, mailbox, alerts, ratings and transactions — async save to a temporary file.

Compatible with: GrzybcioRynek 1.0.3Minecraft 26.2Web 0.1.0

Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.

File: plugins/GrzybcioRynek/market-data.yml. Class: ExtendedDataStore. Created on start. Backup: market-data.yml.bak on enable/reload.

Sections

SectionContents
favorites.<uuid>int list — listing IDs
mailbox.<uuid>mailbox entry list
alerts.<uuid>alert list
ratingsrating list
transactionsTX list

Example

yaml
favorites:
  069a79f4-44e9-4726-a5be-fca90e38aaf5:
    - 12
    - 44

mailbox:
  069a79f4-44e9-4726-a5be-fca90e38aaf5:
    - id: "a1b2c3"
      item: {==: org.bukkit.inventory.ItemStack, type: DIAMOND, amount: 8}
      reason: expired
      timestamp: 1730000000000
      previousPrice: 100.0

alerts:
  069a79f4-44e9-4726-a5be-fca90e38aaf5:
    - query: "diament"
      maxPrice: 5000.0
      timestamp: 1730000000000

ratings:
  - seller: "..."
    rater: "..."
    transactionId: "..."
    stars: 5
    timestamp: 1730000000000

transactions:
  - id: "3f2a…"
    listingId: 12
    buyer: "…"
    buyerName: Kupujący
    seller: "…"
    sellerName: Sprzedawca
    item: {==: org.bukkit.inventory.ItemStack, type: DIAMOND_SWORD, amount: 1}
    price: 1500.0
    fee: 75.0
    sellerReceived: 1425.0
    state: COMPLETED
    timestamp: 1730000000000
    nexoId: null
    oraxenId: null
    error: null

error on refund: REFUND:<epochMs>.

Atomic save

saveAsync() → async scheduler → save():

  1. write to market-data.yml.tmp
  2. ATOMIC_MOVE onto market-data.yml
  3. if atomic fails — normal move with replace
  4. final fallback: data.save(dataFile)

Reload: flushAndSave() (synchronously under lock) + backup().

Retention

pruneHistory removes from transactions only COMPLETED older than history.retention-days. Other sections are not auto-cleaned (except favorites when a listing disappears).

What is missing here

SQL, a separate history file, Discord webhooks.