listings.yml
Runtime listings YAML — listings, next-id, expiry-outbox, pending-returns, pending-sales.
Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.
File: plugins/GrzybcioRynek/listings.yml. Class: StorageManager. Created on first start. Do not edit while the plugin is enabled — save() will overwrite the file.
Backup: listings.yml.bak on enable/reload (backupListings, REPLACE_EXISTING).
Main keys
listings:
- id: 1
seller: "069a79f4-44e9-4726-a5be-fca90e38aaf5"
sellerName: Gracz
item: {==: org.bukkit.inventory.ItemStack, type: DIAMOND_SWORD, amount: 1}
price: 1500.0
timestamp: 1730000000000
nexoId: custom_sword # optional
oraxenId: steel_blade # optional
next-id: 2| Key | Type | Role |
|---|---|---|
listings | map list (MarketListing serializable) | Active listings |
next-id | int | Next ID; on load max(file, maxId+1) |
expiry-outbox.<id> | section | Expired return journal |
pending-returns.<uuid> | item list | Offline returns when mailbox disabled |
pending-sales.<uuid> | list | Sale notifications for offline seller |
pending-sales.by-name.<nick> | legacy | Cleared on join |
Listing fields
| Field | Required | Description |
|---|---|---|
id | yes | Unique int |
seller | yes | UUID string |
sellerName | no | Fallback "Nieznany" |
item | yes | Bukkit ItemStack; AIR / amount≤0 = listing rejected on parse |
price | yes | double |
timestamp | yes | epoch ms — base for listing-expiry-days |
nexoId / oraxenId | no | Pack ID; missing = vanilla / stack only |
expiry-outbox
Written before removing the listing from the list (crash-safe):
expiry-outbox:
"42":
seller: "069a79f4-44e9-4726-a5be-fca90e38aaf5"
item: {==: org.bukkit.inventory.ItemStack, type: DIAMOND, amount: 16}
price: 100.0
reason: expiredprocessExpiryOutbox deletes the entry, then delivers the item. Empty / bad UUID = entry removed.
pending-returns
When mailbox.enabled: false and seller offline (or addPendingReturnPublic):
pending-returns:
069a79f4-44e9-4726-a5be-fca90e38aaf5:
- {==: org.bukkit.inventory.ItemStack, type: IRON_INGOT, amount: 32}On join the plugin tries to put the item into inventory.
pending-sales
Sale while seller offline — notification on join (buy.seller-notified):
pending-sales:
<seller-uuid>:
- buyer: NickKupującego
item: "DIAMOND_SWORD"
price: 1500.0pending-sales.by-name.<nick> is the old format; on join it is read and cleared.
Save
save() synchronously: listings + next-id (+ other sections in the same dataConfig). No atomic temp save (that is for market-data.yml).