GrzybcioRynek

Expiration

Listings expire after listing-expiry-days from timestamp; timer every 30 minutes plus plugin start.

Compatible with: GrzybcioRynek 1.0.3Minecraft 26.2Web 0.1.0

Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.

Listing lifetime = settings.listing-expiry-days days from MarketListing.timestamp. Default 7. Check: on onEnable and every 30 minutes (20L * 60 * 30 ticks) in MarketPlace. Also after /market reload.

Condition

now - timestamp > listing-expiry-days in milliseconds

A reserved listing (purchase in progress) is not expired in that run.

Flow (StorageManager.removeExpiredListings)

  1. Collect expired, skipping reservedListings.
  2. First write journal expiry-outbox.<id> (seller, item, price, reason expired) and clear favorites.
  3. Remove listings from the list, save().
  4. processExpiryOutbox() — deliver item.

Journal → remove order exists so a crash cannot lose the item or duplicate the listing.

Outbox

yaml
expiry-outbox:
  "42":
    seller: "069a79f4-44e9-4726-a5be-fca90e38aaf5"
    item: {==: org.bukkit.inventory.ItemStack, type: DIAMOND, amount: 16}
    price: 100.0
    reason: expired

On processing the entry is deleted before delivery; on delivery error the item returns to outbox / mailbox.

Where the item goes

SituationResult
Seller online, has spaceInventory + messages.expiry.returned
Online, no space / remainderMailbox (mailbox.enabled) or drop / pending-returns
Offline, mailbox enabledmarket-data.yml mailbox, reason expired
Offline, mailbox disabledlistings.ymlpending-returns.<uuid>

/market admin forceexpire <id> uses the same return path with reason expired (without waiting for the timer).

Configuration

yaml
settings:
  listing-expiry-days: 7

0 means immediate expiry on the next timer tick (time difference > 0). Do not set negative values — the code does not sanitize them separately.

Full key description: configuration/expiration.