GrzybcioRynek

MarketListing

Market listing model — fields, YAML serialization, and ItemStack recreation.

Compatible with: GrzybcioRynek 1.0.3Minecraft 26.2Web 0.1.0

Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.

MarketListing (model/MarketListing.java) is an active listing. It implements ConfigurationSerializable and is registered in MarketPlace.onEnable via ConfigurationSerialization.registerClass(MarketListing.class).

Fields

FieldTypeMeaning
idintlisting ID (StorageManager.nextId)
sellerUUIDseller
sellerNameStringnick at list time; missing → "Nieznany"
itemItemStackstored item
pricedoublefixed price
timestamplongSystem.currentTimeMillis() at creation
oraxenIdStringOraxen ID or null
nexoIdStringNexo ID or null

Constructor: new MarketListing(id, seller, sellerName, item, price, timestamp, oraxenId, nexoId).

There is no “active / reserved” field. Reservation during buy is in memory: MarketManager.reservedListings.

Serialization to listings.yml

serialize() writes: id, seller (UUID as string), sellerName, item, price, timestamp. oraxenId / nexoId only when non-null.

deserialize(Map) requires item via ItemStackSerializer.parse. Missing item:

text
IllegalArgumentException: Brak przedmiotu w ofercie #<id>

Missing number for id / price / timestamp:

text
IllegalArgumentException: Brak lub nieprawidłowa wartość dla: <klucz>

StorageManager.parseListing also accepts the older Map format and calls MarketListing.deserialize. Damaged item: log Pominięto oferte #<id> - brak przedmiotu.

Creation

StorageManager.createListing(seller, sellerName, item, price, oraxenId, nexoId):

  1. id = nextId++
  2. timestamp = System.currentTimeMillis()
  3. add to in-memory list
  4. synchronous save() to listings.yml

Nexo/Oraxen IDs are set by MarketManager.sellItem via CustomItemsHook.getNexoId / getOraxenId before taking the item from the hand.

Recreating the item

On buy, remove, and expiry the item goes through CustomItemsHook.recreateItem(listing):

  1. clone stored ItemStack (enchantments, PDC, name);
  2. rebuild from pack ID only when stored type is AIR.

Expiry

A listing expires when now - timestamp > listing-expiry-days (default 7 days). Timer in MarketPlace: every 30 minutes. A reserved listing (isListingReserved) is skipped.

ClassRole
MarketTransactionbuy flow (UUID-string ID, states, fee)
BrowseContextGUI filter: category, sort, page, query, seller, favorites
SortModeCHEAPEST, EXPENSIVE, NEWEST, OLDEST, MOST_AMOUNT, LEAST_AMOUNT
MailboxEntryitem return (reason, previous price)
PriceAlertprice alert
SellerRatingrating 1–5 linked to transactionId