Item Serialization
Bukkit ItemStack in YAML plus optional nexoId/oraxenId — recreateItem clones the stack, rebuild only on AIR.
Compatible with: GrzybcioRynek 1.0.3Minecraft 26.2Web 0.1.0
Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.
Listing and transaction items are stored as native Bukkit ItemStack in YAML (ConfigurationSerializable). Additionally, if a hook detected something, strings nexoId / oraxenId are saved.
Parse
ItemStackSerializer.parse:
- already
ItemStack→ clone, if not AIR andamount > 0 Map→ItemStack.deserialize- AIR / amount ≤ 0 / exception →
null
A listing without a valid item is skipped on load (parseListing / deserialize throws / returns null).
Listing save
MarketListing.serialize():
yaml
id: 1
seller: "…"
sellerName: Gracz
item: {==: org.bukkit.inventory.ItemStack, type: DIAMOND_SWORD, amount: 1, meta: …}
price: 1500.0
timestamp: 1730000000000
nexoId: my_sword # only when not null
oraxenId: steel_bladeSame goes into TX in market-data.yml.
recreateItem
clone(stored)
if stored is AIR:
try Nexo with nexoId
else try Oraxen with oraxenId
return stored (clone)
Goal: keep enchants, PDC, display name from listing time. Pack is plan B for damaged data (AIR).
Mailbox and outbox
Mailbox and expiry-outbox also hold ItemStack in YAML. Outbox uses recreateItem when queueing.
What is missing
- Separate base64 format
- SQL BLOB
- ItemsAdder namespaced-id
- Rewriting the item on every
load()