GrzybcioRynek

Change listing expiration

Listing lifetime (listing-expiry-days) and cleanup timer every 30 minutes.

Compatible with: GrzybcioRynek 1.0.3Minecraft 26.2Web 0.1.0

Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.

A listing has a listing date and expires after N days. Default 7.

Key

yaml
settings:
  listing-expiry-days: 7

ConfigManager.listingExpiryDaysgetInt("settings.listing-expiry-days", 7).

30-minute timer

On start the plugin immediately calls storageManager.removeExpiredListings() and processExpiryOutbox(), then repeats this every 30 minutes:

java
storageManager.removeExpiredListings();
storageManager.processExpiryOutbox();
Bukkit.getScheduler().runTaskTimer(this, () -> {
    storageManager.removeExpiredListings();
    storageManager.processExpiryOutbox();
}, 20L * 60 * 30, 20L * 60 * 30);

20L * 60 * 30 ticks = 30 minutes. A listing may therefore hang up to ~30 minutes after exceeding listing-expiry-days before the timer collects it. Reload also calls removeExpiredListings().

What happens after expiry

Item returns to the seller (inventory or mailbox when mailbox.enabled). Message:

yaml
messages:
  expiry:
    returned: "Twoja wygasła oferta &e{item} &7została zwrócona do ekwipunku."

Admin can force: /market admin forceexpire <id>.

How to change

  1. listing-expiry-days: 3 (shorter market) or 14.
  2. /market reload.
  3. GUI lore shows messages.gui.lore.expires ({time}).
Note

history.retention-days: 30 is transaction history retention, not listing lifetime. Do not confuse these keys.

What is missing

Real auctions with an “auction end”. Expiry removes a fixed-price listing from listings.yml.