Mailbox
Return mailbox — reasons, GUI, pending-returns when mailbox.enabled is false.
Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.
The mailbox holds items that could not be returned to inventory immediately. Service: MailboxService. Data: market-data.yml → mailbox.<uuid>. GUI: MailboxGUI (54 slots).
market.mailbox from plugin.yml is not checked in Java.
Flag mailbox.enabled
Default true.
enabled | What happens on deposit |
|---|---|
true | Entry in mailbox in market-data.yml |
false | Player online: addItem, remainder drop at feet. Offline: listings.yml → pending-returns.<uuid> |
Command /market mailbox and browse button (slot 48) open the GUI regardless of the flag. The flag controls delivery, not menu visibility.
Reasons (reason)
| Reason | Source |
|---|---|
expired | Expiry timer / forceexpire |
removed | Owner removed listing (/market remove) |
admin-removed | /market admin remove |
admin-refund | /market admin refund … reclaim — item to seller mailbox |
purchase-overflow | Purchase: addItem did not fit the full stack (after earlier canFit) |
GUI lore: messages.gui.mailbox.lore.reason with {reason}.
GUI
| Slot | Role |
|---|---|
| 10–16, 19–25, 28–34 | Entries (hardcoded) |
| 45 | Back |
| 48 / 50 | Pages |
| 49 | Claim all (claimAll) |
| 53 | Page indicator |
Click = MailboxService.claim (atomically removes entry; if no space, restores + mailbox.inventory-full). Shift+click = relist: removes entry, asks for price on chat (relist.prompt). cancel / anuluj → relist.cancelled and restore entry.
Empty mailbox: messages.mailbox.empty (barrier on slot 22).
Server join
PlayerJoinListener:
- hint
messages.mailbox.join-hint({count}) when there are entries, - deliver
pending-returns(when mailbox was disabled), pending-salesnotifications (sale while seller was offline); legacypending-sales.by-nameis cleared on join.
Claiming
claim requires space (InventoryUtil.canFit). claimAll stops on the first failed claim.
Success: mailbox.claimed ({item}). New online deposit: mailbox.received.