Build a NEW, clean-room, complete Minecraft Paper economy plugin in this EMPTY project. User explicitly requested a from-scratch replacement, not more patching. Workspace project label Cookie SMP Economy Clean; plugin display name Cookie SMP Economy (safe Bukkit descriptor name CookieSMPEconomy), version 1.0.0. Do NOT copy/reuse previous implementation, do NOT edit the old project. All source/resource/docs produced here. No dependency links, no bundled Teams/extra features. Main package e.g. com.cookiesmp.clean, separate focused managers/repositories/commands/listeners/GUI types, not giant classes. Implement ALL features below, no stubs or TODO substitutes. You cannot run builds or a real Paper server. Do NOT write tests, test scripts, mock servers or test files, and do NOT claim runtime tests were run. I will compile via workspace tool after you finish.
NONNEGOTIABLE TARGET: Java 21, Paper 1.21.11, compileOnly io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT, Java toolchain/release 21, plugin.yml api-version '1.21.11', correct fully qualified main. The previous existing project was inspected and currently uses Paper 26.2 + Java25, which is WRONG for this new request; do not inherit those template versions. Configure repository/build correctly, no NMS, avoid deprecated methods where current API exists. SQLite JDBC must actually be available in deployable artifact: configure a self-contained shaded JDBC jar/dependency packaging supported by this workspace AND manifest.kod as required, preserving service loader/native libs. Avoid requiring separate plugins, internet library downloads at boot or arbitrary Lombok dependency. State exact jar filename/path. Source download and complete config/docs must exist.
FORBIDDEN features: absolutely NO player-owned warps (/pw), Jobs (/jobs), player-to-player Trading (/trade), Recycler (/recycler or renamed equivalents), no command/permission/menu/listener/class/dependency for those. Do not add unrelated Teams/teleports/ranks/crates etc. AH and Orders are explicitly wanted market systems, not direct player trading. Existing project remains untouched and independently downloadable. Use a NEW distinct data folder; explain old jar must be removed/disabled before installing new to avoid command clashes. Do not silently migrate/read/reset legacy DB. User asks updates never reset data: new plugin's schema must be versioned, non-destructive and upgrade-safe. Document no automatic legacy data import rather than claiming old data transferred. No money/admin backdoor; optional properly permissioned balance management only if genuinely needed for administration and documented.
CORE architecture/security:
- SQLite tables for UUID accounts/names, all money transaction ledger, sell history, auctions, orders/escrow, persistent item mailbox, bounties/contributions/history, collections/reward claims, daily claims. Prepared statements, foreign keys/constraints/indexes, safe connection ownership and transactions, WAL/busy_timeout, versioned additive migrations with backup for existing DB. Close resources/shutdown safely and partial-startup cleanup. All managers correctly initialized; fail closed and log full cause, disable gracefully on fatal init. Config safe defaults/validation, explicit exact causes rather than silent catch. No empty catches.
- Use integer cents and strict BigDecimal parsing (positive, finite, precision/overflow/balance limits); Math exact arithmetic; no doubles for amounts, negative/NaN/infinity/exponent loopholes, no overdraft or duplicate credits. Atomic conditional updates, unique transaction/action IDs, idempotency across repeated clicks/callbacks; double click spam cannot repurchase same confirmation. Legitimate repeated purchases must remain possible after successful refresh/new action. Player resolution only known UUID/name cache or online players (no blocking name lookups/made-up accounts); offline known players supported. All inventory/Bukkit operations main thread; use serialized DB executor for meaningful database operations and marshal callbacks to main. Never access player inventory/unsafe Bukkit data asynchronously; use frozen snapshot/serialization created on main. Lock per-player in-flight mutation, check session/online state and revalidate inventory when async result returns. Ensure startup and shutdown executor sequencing doesn't deadlock and completion callbacks can't mutate after disable.
- SQLite vs world/player saves cannot share a single ACID commit: use clear durable reservation/recovery state, deterministic compensation and persistent mailbox and fail-closed ambiguous states, don't falsely promise arbitrary-crash perfect atomicity. Important: handle normal exceptions/reconnects without granting both money/items. Capture inventory snapshot and verify exact match before removing; no arbitrary rollback overwriting newer inventory. Document ambiguous crash recovery/admin procedure if unresolved. No automatic replay of possibly delivered mailbox items.
- Typed InventoryHolder/view session with owner UUID, unique action tokens/revision and validated slot map, NEVER recognize GUIs merely by title. Cancel GUI top/bottom transfer hazards (shift,double click,number keys,offhand,collect,drag,etc). Handle close/quit cleanly without losing sell items. Prefer Sell GUI operates on player inventory/preview or controlled deposit that safely returns/queues all leftovers on close; make UI behavior clear. No dropped valuable leftovers and no duplication via previews. Paginate large lists and queries, don't load everything on each tick; no unnecessary main-thread SQLite queries. Configurable caps/cooldowns protect abuse.
COMMANDS / FEATURES (all plugin.yml entries, permissions, sensible defaults, explicit executors and appropriate tab completion/help, console handling): 1 ECONOMY /balance /bal /money [known-player], /pay <player> <amount>, /baltop [page], /moneytop alias. UUID balances persist, offline payments, starting balance once only, consistent configurable currency formatting, reject self-payment/unresolved players/invalid nums/overflows, safe history ledger. All users default ordinary nodes, admin nodes op only. 2 SHOP /shop: clean category GUI, configurable categories/items/price/amount, quantity/purchase confirmation for appropriate transactions, capacity and money check, repeated purchases without closing and automatic refresh; stale confirmations/rapid duplicate click can't pay/deliver twice, failed purchase not charged, no free items. Default sensible sample shop and sell prices preventing sample arbitrage; clearly editable. Do not import old broken config or autoassign all sell prices. 3 SELL /sell opens functional GUI; /sell hand sells main hand stack only; /sell all and /sell inventory storage contents only (not armor/offhand unless explicitly chosen). Plan precise item/amount/order route from snapshot, revalidate on commit, correct inventory removal, safe atomic payout/escrow changes, no duplicate histories, preserve unsellable remainder. Default normal sell is plain material items only to avoid stripping valuable metadata; orders can buy exact metadata. Document policy. Config sell.prices sole price source for all consumers. 4 SELL ADMIN /sell missing [page]: cookiesmp.sell.admin default op enforced for path and completions, console works, list runtime Material.values valid inventory items (!isAir, isItem, !isLegacy, ignore impossible forms), logical categories if practical, stable pagination and total, NEVER autoassign missing prices. /sell set "<item>" <price>: normalize enum, names/spaces inside quoted names with correct Bukkit argument joining, malformed/excess args helpful usage, only valid inventory material, strict positive exact cents, persistent atomic config-file write BEFORE publish to live readers (rollback on failure), immediate sell/worth/missing/shop integration where selling-price dependent, don't mutate buy prices. Permission cannot be bypassed by aliases. Admin material tab completion, ordinary players don't see admin suggestions. 5 WORTH /worth, /worth hand, /worth <item> accepts same item normalization, name, per-item normal selling price and total held stack value (or 1 for explicit type), explain unsellable/custom metadata as applicable; use same live prices as sell (can mention better order separately but don't misrepresent base). 6 SELL HISTORY /sellhistory [page]: SQLite real transactions, UUID, item name/template info, amount, revenue, date/time, newest first stable pages, normal + order routes with unique action/line keys no duplicates, no other players' history without separate op permission. 7 AUCTION HOUSE /ah GUI, /ah sell <price> lists held stack with metadata, /ah search <item> filtered results, /ah history [page]. Durable listing states/escrow item, atomic conditional claim/purchase, debit buyer and credit online/offline seller once, persistent safe mailbox delivery, enough money/full-inventory handling, no self-buy; pending listing failure returns item once, expiry returns to mailbox at most once. Config limits/TTL, pagination/refresh/search, true per-user history. Exact serialized ItemStack, not material-only replacement. 8 ORDERS /order GUI, /order create <item> <price-per-item> <amount>, /order deliver <id>, /order cancel <id>, /order my [page], /order mailbox. Optional 'hand' item for creating exact metadata order; regular material creates plain stack template. UUID owner escrow reserves total once atomically using safe multiplication; deliveries exact isSimilar normalized amount, partial fills from seller storage/pay unit price; buyer can be offline, always durable mailbox; on join and explicit mailbox claim deliver capacity that fits and persist remainder. Cancellation only own active order refunds remaining*unit once; no self-fulfillment and expiry refunds once. Query matching indexed data, revalidate live order states under transaction.
SMART SELL: sell hand/all/GUI compare configured normal price vs highest matching active orders excluding own. Only strictly higher order price wins; ties/lower sell to server. Fill best price first, then next eligible order, partial capacity, normal sell any remaining with price; items with no normal price may fulfill positive matching order and UNSOLD remaining stays in inventory. Match complete relevant item metadata, legacy material fallback not necessary in this new DB. Same atomic sale action allocates all chosen order remainders/escrow, seller payout, buyers' mailbox and history. Concurrent fills or stale GUI must replan/fail safely, never payout capacity twice. 9 BOUNTY /bounty GUI/default help, /bounty add <player> <amount>, /bounty check <player>, /bounty top [page], /bounty history [page], /bounty cancel <player>. Multiple independent contributions, reserve money/debit atomic, cancel refunds ONLY caller's remaining contributions (not others) once. PlayerDeathEvent valid PvP killer including projectiles using killer, no environmental death (check actual final cause attributable to player, not just previous getKiller), self-kills invalid, prevent killer recovering own contribution by collusion/self-funded targeted kills. Durable per victim/killer cooldown anti farming across restarts and config minimum victim playtime if feasible, no blanket false promise collusion impossible. Atomic claim once event death token + settled contribution states, histories/ledger. Genuine constraints documented. Offline target/contributors supported. 10 COLLECTION BOOK /collection GUI, /collection stats, collection progress/statistics item registration from appropriate pickup/craft/inventory registration without item consumption, persistent unique UUID/material entries once; ignore cancelled pickup/craft and track actual items received where possible not preview products. GUI progress stable pagination; optional configurable collection milestone/completion rewards default disabled and exact once durable claim in same transaction as money reward. Player can explicitly register inventory if helpful. Do not invent item loss or repeat rewards. Use known valid inventory materials and unique denominators. 11 DAILY/EVENTS /rewards GUI, /daily claim/cooldown GUI or clear usage, /moneytop, /events GUI. Daily amount/cooldown config, exact once DB conditional claim and money credit transaction, persistent timestamp restart-safe, format remaining time. Rewards GUI buttons functional with same claim implementation. Events GUI list actual configured events/schedule/status/messages; don't fabricate scheduled events with real payouts not implemented. Empty config shows clear 'no active events'. If include configured reward events implement safe eligibility/idempotency or only informational configurable events clearly documented. No unrelated hidden placeholder commands. 12 CONFIG: currency symbol/format, starting balance, sell prices, shop categories/prices/quantities, daily rewards/cooldown, all GUI titles, messages incl validation/success where practical, optional collection rewards, bounty anti-farm, limits, admin nodes where appropriate. Prices editable with no recompile; /sell set immediate, if adding /cookieeconomy reload make op-only robust atomic validate reload with helpful report and refresh existing sessions. Protect GUI click revisions on reload. Proper YAML/resource filtering and plugin.yml version.
DELIVERY/docs: README.md with supported Paper1.21.11 Java21, installation single deployable jar, remove old economy plugin to avoid commands conflict, distinct DB/data location/no automatic legacy data transfer (old data untouched), full implemented command syntax and permissions, configuration layout, schema/migration/backup/recovery behavior, differences between source inspection and actual verification. IMPLEMENTATION_REPORT.md honest concrete features + known limitations + verification: no compile yet by you, no live server, no green /plugins claim, no restart/database/gameplay/exploit tests actually executed. Do NOT ask user to write/run tests. No forbidden features in code/resources/menus (you can mention absence in docs but no implementation). Report final expected jar path as from actual Gradle conventions. Must not claim fully tested/stable if only code inspection. Finish complete functionality then return concise summary for my compilation.
Build the Java 21/Paper 1.21.11 foundation, versioned SQLite storage, and durable inventory-operation recovery.
Implement economy, shop, smart selling, auctions, orders, and persistent mailbox flows.
Add bounties, collections, daily rewards, secure menus, and permissioned administration.
Provide editable configuration and installation/recovery documentation, clearly separating implementation from unperformed verification.
The main systems and secure inventory menus are in place. I’m completing the recovery safeguards and documentation; compilation and live-server verification have not been run.
Created Cookie SMP Economy 1.0.0 for Paper 1.21.11 / Java 21, including economy, smart selling, shop, auctions, orders/mailbox, bounties, collections, daily rewards, and secure GUIs.
SQLite JDBC packaging, versioned storage, transaction ledger, and reservation/recovery journal configured.
Complete configuration,
README.md, andIMPLEMENTATION_REPORT.mdincluded.Distinct data directory:
plugins/CookieSMPEconomyClean/.No legacy data imported or old project modified. Remove/disable the old economy JAR before installation.
Expected build outputs:
build/libs/CookieSMPEconomy-1.0.0.jarbuild/libs/CookieSMPEconomy-1.0.0-sources.jar
Not compiled or live-server tested by me. Crash-boundary limitations and explicit administrator recovery procedures are documented.
Focused post-build deployment/dependency repair in existing clean project. Workspace compile of this project SUCCEEDED (real compile tool, not a live-server test). I inspected actual build.gradle/manifest.kod/source afterward and found an unconfigured external runtime dependency: src/main/java/com/cookiesmp/clean/Items.java imports com.cryptomorin.xseries.XMaterial and Items.material(String) invokes it. build.gradle only declares Paper API and SQLite, manifest.kod only sqlite-jdbc. This can lead to NoClassDefFoundError during Settings.load at startup on clean Paper even though workspace classpath compilation succeeds. Since target is specifically Paper 1.21.11 there is NO need for cross-version XSeries: remove that import and all XMaterial usage; resolve normalized valid inventory materials using ONLY Paper/Bukkit Material API / enum lookup, preserve case-insensitive material names, spaces/hyphens normalization and optional minecraft namespace if supported/documented, reject air/legacy/!isItem exactly as before. Do not add another dependency merely to mask this. Inspect remaining project imports for any other unconfigured external types; only Java/JDK, Paper/Bukkit and server-provided Adventure APIs should be used besides runtime SQLite. Preserve all implemented features, schema/data safety, no rewrite and no prohibited features.
Also update IMPLEMENTATION_REPORT.md and README verification sections to accurately reflect: initial workspace compiler check succeeded for configured Java21/Paper1.21.11 project, this focused repair requires a fresh compiler check by workspace lead after edits; no live Paper start, green /plugins, database creation/execution/restart, gameplay, native JDBC packaging/exploit tests have been performed. Remove stale 'user will compile separately' or 'never compiled' statements, but do NOT claim runtime verification. Keep any static/artifact verification caveats honest. If useful add clear dependency audit note explaining removal of accidental XSeries reliance.
Do not run builds or create tests/scripts. I will recompile after your report. Return concise changes and any remaining deployment dependency concerns; expected deploy jar build/libs/CookieSMPEconomy-1.0.0.jar. Old project KDR-202611-7T738MCK remains untouched.
Audit material resolution and runtime dependencies, then make the focused repair.
Update verification notes to distinguish the successful initial compile from unperformed runtime checks.
Removed XSeries reliance from
Items.material; Bukkit-only lookup preserves case-insensitivity, space/hyphen normalization, optionalminecraft:prefix, and existing air/legacy/non-item rejection.Audited production imports/references: no other unconfigured external types found. No dependencies added; features, schema and persistence unchanged.
Updated both reports: initial Java 21/Paper 1.21.11 workspace compile succeeded; post-edit compiler check remains required. No runtime verification claimed.
Remaining deployment concern: SQLite JDBC artifact contents, native loading and live Paper startup remain unverified.
No builds or tests/scripts were run or created. Old project untouched.
Expected deploy JAR: build/libs/CookieSMPEconomy-1.0.0.jar.
Update the CURRENT clean CookieSMPEconomy project to match the user's reference visuals and add live shop item administration. Do NOT edit the old project KDR-202611-7T738MCK or make a new plugin. Target remains Paper 1.21.11 / Java21. I inspected actual files: EconomyCommands currently handles /shop no args, Settings defines Category(id,name,icon,products)/Product(id,material,amount,price), ConfigManager has safe async atomic sell-price file persistence, Menus.categories/products currently place items from slot0 with navigation bottom, MenuSession is typed 54-slot with action tokens/generation. Main CookieEconomyPlugin has async DB ready callback and task lifecycle; no scoreboard/tab presentation exists. Existing project compiled successfully after removing accidental XMaterial dependency. Preserve all working economy/sell/order/auction/bounty/collection/rewards/data recovery/security features. No tests/test scripts/mock servers and do not run builds; lead compiles after your edits.
USER REQUEST: 'make it so it looks like this but replace the Parrot SMP with Cookie SMP and anything red replace with orange and instead of the feather replace it with cookie and make that i can add items to the categorys by EXAMPLE /shop add PvP totem_of_undying 1.5k'. They supplied four reference screenshots unavailable to you, described precisely below. Implement practical vanilla/Paper GUI equivalents; do not require a resource pack or promise pixel-identical custom fonts. Work from these descriptions, no need for original image asset files.
VISUAL REFERENCES: 1 item tooltip: first line 'Oak Log' white, second italic gray 'each' then bright green '$24'. Remaining lines minecraft:oak_log and '12 component(s)' are client's advanced-tooltip/debug display, NOT plugin lore: do not fake them. Human-readable item names (title case, underscores removed) and concise per-item price lore. Use real configured price, never hardcode screenshot price. For products bundles show each unit price accurately and bundle/quantity/total separately as needed (cent-safe display including fractional per-unit when bundles don't divide evenly), confirmation remains safe. 2 tab list: centered header top thin red line, 'PARROTSMP • Survival' bold red brand, white/gray Survival; next 'Online: 9' white. Actual player names with live native heads/ping bars; example Owner label colored red. Bottom centered 'Ping: 35ms' with green value and a red line. New version orange (#FFAA00 or &6), brand 'COOKIE SMP' / 'Cookie SMP', live online count and each viewing player's real ping, optional configurable rank/name prefix rules if feasible but do NOT invent ownership/ranks or fake players. Native ping bars/player heads stay native. Header/footer only by default; preserve existing player list names/prefixes from other plugins. Real names not fake reference names. 3 sidebar: title bold 'PARROTSMP' red above thin red separator; blank then player name white; lines money icon Balance: $1k (green), crossed swords Kills: 0 (red), skull Deaths: 0 (red), diamond Team: No team (yellow), clock Playtime: 1m 30s (purple), lightning Ping: 41ms (yellow), bottom thin red separator then '[>] Store coming soon' yellow/green. New version all red visual accents/numeric kills/deaths orange, title 'COOKIE SMP', balance green, correct real data: actual economy balance (compact k/m/b formatting), player kills/deaths/playtime from Paper stats, real ping. Team can display actual existing scoreboard team (main/external) if meaningfully available; otherwise configurable 'No team'. Do NOT add a new team feature just for this, don't fabricate. Store line configurable with safe default 'Store coming soon', no invented store URL. Symbols may use vanilla compatible text/unicode fallbacks. Sidebar must not show score numbers if supported by Paper API. Unique entries for spacer/separator lines, no flicker/recreate each tick. All balance reads async through serialized DB executor, use cached immutable snapshot, no main-thread SQLite. Configurable reasonable update interval (e.g.40ticks), only one batch/inflight refresh, don't grow DB queue unbounded, handle joins/quits/reload/disable/readiness cleanly. Bukkit scoreboard/player/statistic mutations/reads main thread; worker only DB snapshots. Add configurable independent enabled toggles for scoreboard/tab and safe coexistence: don't constantly overwrite another plugin's non-main scoreboard, opt out/skip by default if external sidebar detected, preserve/restore previous owned state only if still yours. Tab lifecycle reset only what this plugin controls as far as practical and document known coexistence behavior. No external scoreboard/TAB plugin dependency. 4 shop GUI: 6 rows, title 'Parrot Shop • Page' with Parrot Shop red/salmon, secondary gray. Most slots empty gray vanilla inventory background (don't fill whole GUI with colored glass). Five category icons horizontally CENTERED at zero-based slots20,21,22,23,24: END_STONE (blocks), COOKED_BEEF (food), TOTEM_OF_UNDYING (PvP), FEATHER (other/special), NETHERRACK (nether). Replace FEATHER with COOKIE. Footer bottom left slot45 gray cube/control, center49 NETHER_STAR (navigation/refresh), bottom right53 red glass/control -> ORANGE_STAINED_GLASS_PANE (close or functional footer). New title '&6Cookie Shop &8• &7Page {page}' (or matching readable spacing). Style existing categories dynamically: lay out up to five centered horizontally at20..24, paginate extra categories, extend sensibly only if needed; preserve all configured categories/products instead of hiding them. Use defaults equivalent to screenshot for new installs (Blocks/Building, Food, PvP, Special with COOKIE icon, Nether). Existing config currently has building/resources only: do not overwrite user category contents/prices, support theme fallback slots/icons and explicit user icon overrides; do not delete existing resources category. New 'PvP' category must be available through admin command below if missing. Avoid feather as category icon/default or substituting cookie items for real purchasable feathers; only theme/navigation feather -> cookie. Bottom controls meaningful (back/category/previous/next/close) and not conflict with existing pagination; retain correct page access. Product/category menus and confirmation cohesive orange Cookie SMP theme, red accents on GUI controls become orange. Do not recolor legitimate item textures or real player skins. Keep robust typed holder, permissions, generation/session checks, click/drag/hotbar prevention and repeated valid purchases.
SHOP ADMIN EXACT COMMAND: /shop add <category> <material> <price> Example /shop add PvP totem_of_undying 1.5k adds TOTEM_OF_UNDYING to PvP with price 1500 currency PER ONE ITEM. Permission cookiesmp.shop.admin, default op; console supported. Normal /shop stays accessible to normal users but no admin args/suggestions unless permitted. Case-insensitive category lookup by normalized ID and uncolored display name; support quoted category names with spaces if practical using robust parser. Material normalized using existing Items.material (case-insensitive names underscores, no XSeries). Ignore/reject air, invalid/legacy/noninventory items. Parse strictly positive price with OPTIONAL case-insensitive suffix k/m/b via BigDecimal (1.5k=1500; also support ordinary 1500/1500.00), enforce exact cents/cap/overflow, reject NaN/infinity/negative/zero/excess precision/malformed values. This shop-only parser must not relax global transaction validation. Item amount defaults1; explicitly confirm per-item amount and formatted price. If category does not exist, create a normalized category safely (choose icon material being added or CHEST; PvP sensible TOTEM icon), allowing user's example to work without manual config edits. Upsert deterministic product entry for normalized material: adding same material again updates its price/amount rather than silently creating duplicate entries. Preserve distinct existing custom product variants where not same intended plain material; carefully define/document duplicate handling using current simple Product model. Do not touch sell.prices, accounts or any other data. Do not automatically alter existing prices elsewhere. Don't add unrelated admin command surface unnecessarily; /shop add alone plus existing reload sufficient. Invalid args helpful usage. Admin-only tab completion: add, existing category IDs/names, valid material names, sample price suggestions with k notation if appropriate. Category creation rules clear.
PERSISTENCE AND LIVE CONFIG:
Persist /shop add into existing config.yml shop.categories.<id>.items using same atomic file-write safety as ConfigManager.setPrice; validate full candidate before write/publish, rollback in-memory on write failure and report full logged cause. Share single writing gate across setPrice/shop writes/reload to prevent lost updates, read/merge actual file content so unrelated manual settings aren't lost, publish immutable Settings only AFTER durable successful atomic move. Main-thread YAML snapshot and worker I/O boundary safe. New prices/categories visible immediately without restart. Invalidate stale purchase tokens/open sessions on product changes; never let old-priced pending confirmation buy. Existing reload must reload presentation settings safely and update visuals without duplicate scheduled tasks. New presentation configuration must have safe fallback defaults for already-existing config missing keys, new shipped config includes keys. Keep target API/dependencies unchanged, no new unnecessary external library.
DELIVERY:
Update README.md and IMPLEMENTATION_REPORT.md with /shop add usage/examples/permission, suffix parsing/upsert/category creation semantics, orange shop/sidebar/tab config, coexistence controls, real data sources and live-update behavior. Verification must remain truthful: earlier build passed but these latest changes not compiled yet, no live Paper/green plugins/gameplay/restart/native packaging tests performed. No fake test claims. Return changed features, any real limitations. Expected jar build/libs/CookieSMPEconomy-1.0.0.jar. Do not reintroduce any user-prohibited systems or rewrite working systems unnecessarily.
Add permissioned
/shop addwith atomic configuration writes and immediate session invalidation.Apply the orange Cookie SMP shop theme while preserving configured categories and products.
Add configurable live sidebar/tab presentation with async balances and conservative coexistence.
Update documentation and verification notes without running builds or tests.
[Generation stopped]
Continue the in-progress orange Cookie SMP visual/shop work in THIS current clean project with the user's latest change, which supersedes the previous request to seed categories or auto-create them. The previous delegation was cancelled only to incorporate this requirement; its partial edits remain. I just read EconomyCommands.java and ConfigManager.java: /shop add is partly implemented, addShopItem currently resolves OR CREATES categories, tab completion hardcodes PvP. Fix this rather than starting over. Do not edit old project KDR-202611-7T738MCK. Paper1.21.11/Java21 unchanged. Do not run builds or write tests/scripts/mock servers; lead compiles afterward. User asks that plugin actually work: deliver functional code with safe permissions/persistence, not mockups; do not claim live testing unavailable to you.
LATEST USER REQUIREMENT: 'dont add any category to /shop because ... i will add them by EXAMPLE: /shop category add "name" "icon"'. Implement admin-only /shop category add <name> <icon> with quoted names/icons supported. Example /shop category add "PvP" "totem_of_undying". Category is created EMPTY, then /shop add PvP totem_of_undying 1.5k adds a single totem priced $1500. Both admin paths permission cookiesmp.shop.admin default op, console supported, no unauthorized access/completion. Create NO automatic or sample categories/products on new installs: default shop.categories: {}. Show useful empty-shop GUI with orange Cookie branding and guidance for authorized admins. Do not seed Blocks/Food/PvP/Special/Nether/etc, do not hardcode suggested nonexistent PvP category, do not recreate categories at startup/reload when empty, and /shop add MUST reject a nonexistent category with instruction to create using /shop category add (NO auto-create). Preserve any existing user-configured categories/items/prices; don't wipe persisted config/data, only remove new-build seeded shipped defaults and hidden fallback injection. If previous partial change seeded categories only in resource config, replace with empty map. Never delete genuine existing user config. User controls all category names, icons and items. 'feather to cookie' from visual request applies to theme/navigation icons only, not overriding a manually chosen category icon; honor supplied valid icon including FEATHER if user expressly selects it.
CATEGORY COMMAND: robust Items.words quote parsing incl malformed quote/excess args, normalize ID safely using ConfigManager.categoryKey (no YAML path injection), resolve by normalized ID or uncolored display name consistently, reject duplicate/ambiguous categories without changing them, validate runtime Material via Items.material (!air,!legacy,isItem). Choose no other icon when supplied; persist selected icon and display name and empty items map. Names with spaces quoted supported, reject invalid keys/names helpfully. Atomic configuration save/publish same single writing gate as sell set/shop add/reload, validate entire candidate before disk; no in-memory update on failed write, log exact cause. Immediate visible menu updates and safe session invalidation. Add admin tab completion for category, add, existing category names for /shop add, materials for icon/material, price examples. plugin.yml usage and README examples updated. Unknown subcommands helpful usage and no fallback exploit.
ITEM COMMAND: /shop add <existing-category> <material> <price> default quantity1; case-insensitive lookup ID/display, per-item positive strict BigDecimal suffix k/m/b (1.5k=1500), exact cents cap/overflow/precision/NaN/infinity/zero negatives rejected; shop-only parser must not relax global transaction money parser. Deterministic update of intended plain-material product instead of duplicate creation; preserve unrelated variants/configs and other sell/shop prices. Persist existing config atomically then publish immutable Settings on main, invalidate stale confirmations and refresh/open shop correctly. No changing sell prices. Prices immediately active without restart.
FINISH EARLIER VISUAL REQUEST (source changes may be partial): user references show vanilla 54-slot shop with empty background, up to 5 centered category icons at slots20..24; footer45 gray cube/back/prev,49 NETHER_STAR refresh/navigation,53 ORANGE_STAINED_GLASS_PANE close/next as needed. Now do not create categories/icons automatically; lay out USER CREATED ones similarly, paginate extras and preserve all existing configured categories, usable meaningful footer/back/prev/next without collisions. Title orange '&6Cookie Shop &8• &7Page {page}'. Product tooltips readable human names (Oak Log) white, italic gray 'each' + green configured unit price (not hardcoded $24); bundle totals correct. Don't fake client debug lore minecraft:.../component count. Feather navigation icon becomes COOKIE, red GUI accents become orange, don't recolor actual item textures.
Tab reference: thin orange separators, bold orange COOKIE SMP • gray Survival, live Online count, footer live per-viewer green Ping value. Preserve native actual names/heads/ping bars and don't invent players/ranks or overwrite external list name prefixes. Sidebar bold orange COOKIE SMP title, real player name, green Balance compact k/m/b, orange Kills/Deaths actual stats, Team actual existing scoreboard-team if meaningful else configurable No team, purple Playtime actual PLAY_ONE_MINUTE ticks formatted, yellow Ping, orange separators, configurable Store coming soon footer. No fake data/new team system/store URL. All DB balance reads asynchronous through serialized executor, only main-thread Bukkit stats/scoreboards/menus, cached bounded batch/single inflight refresh, sensible configurable40ticks default, tasks start only after ready and cleanup on quit/disable/reload. No duplicate scheduling or DB queue growth. Coexistence: optional independent enabled sidebar/tab toggles, skip external nonowned sidebar by default instead of constantly replacing, restore prior scoreboard only if still ours; tab controllable/document header/footer collisions, don't overwrite player list name. Hide sidebar score numbers via actual Paper API if supported. Unique stable entries/no flicker every tick. GUI/session generation safeguards and repeated valid purchases retained. Config safe defaults for missing keys, no unnecessary libraries or XSeries. No resource pack required or pixel-perfect font promise.
Preserve all existing economy, sell/smart orders, AH, bounty, collections, rewards, sqlite/data recovery functionality and data. No forbidden player-warps/jobs/player-trading/recycler features. No new unrelated commands/features. Update README and IMPLEMENTATION_REPORT with actual category creation command, empty default shop, add ONLY existing category rule, shop admin permission and suffix parsing, persistence/session behavior and presentation/coexistence. Earlier project compiled; latest partial visual/category changes require fresh workspace compile. No live Paper/green plugins/restart/DB/native packaging/gameplay/exploit tests have occurred; state honestly. Expected final jar build/libs/CookieSMPEconomy-1.0.0.jar. Return concise implemented changes, remaining actual limitations.
Finish explicit category creation and make
/shop addrequire an existing category, preserving saved shop contents.Complete the orange shop, live sidebar and tab presentation with safe lifecycle handling.
Update configuration and docs for the empty default shop and current verification status.
/shop category add now creates empty categories with the chosen icon, and /shop add rejects missing categories. The shipped shop is empty; saved configurations are preserved. The orange menus and live presentation are wired in, with final coexistence safeguards and documentation still to finish.
Implemented in the current clean project:
Empty default shop—no seeded or automatically created categories.
Admin-only, console-supported commands:
Plain Text/shop category add "PvP" "totem_of_undying" /shop add PvP totem_of_undying 1.5kBoth require
cookiesmp.shop.admin. Item addition requires an existing category.Atomic configuration persistence, immediate price publication, duplicate protection and stale-menu invalidation.
Orange Cookie Shop menus, centered paginated categories, readable prices and functional navigation.
Configurable live sidebar/tab using real statistics, async cached balances and conservative coexistence controls.
Updated README and implementation report. Existing saved shop contents, economy data and recovery flows preserved; old project untouched.
Limitations: vanilla visuals are not pixel-identical custom artwork; external scoreboard and packet-only tab systems may require disabling the corresponding presentation toggle.
Earlier compilation passed. These latest edits remain uncompiled; no builds, tests or live-server checks were run.
Expected JAR: build/libs/CookieSMPEconomy-1.0.0.jar
Perform a thorough end-to-end technical audit AND actual focused repairs of the CURRENT clean CookieSMPEconomy plugin. User: 'please fix the whole plugin and if so take your time for it'. This is not a request for advice or another rewrite. Read all real Java/resources/build/docs and fix concrete defects across startup, packaging, persistence, commands, menus, transactions, concurrency, and shutdown. Preserve working features/config/data and earlier exact requirements. Do NOT edit the old project KDR-202611-7T738MCK. No new project, no code copied from old. Do not run builds or write tests/test scripts/mock servers; workspace lead will compile after your report. You cannot claim live runtime testing.
CONTEXT / IMPORTANT LOADER ERROR:
User's only server trace was '[15:10:35 ERROR]: [ModernPluginLoadingStrategy] Could not load plugins/CookieEconomy-1.0.0 (3).jar' followed only by stack frames ending in paper-26.2.jar:26.2-135-e4d6dfd. No exception message/Caused by was provided. This names the OLD artifact (or renamed file), not current CookieSMPEconomy-1.0.0.jar; it does NOT identify root cause. User originally explicitly required Paper1.21.11/Java21, while actual shown server runs26.2. They have not confirmed a target change. Keep compileOnly Paper1.21.11-R0.1-SNAPSHOT, Java21 toolchain/release, api-version1.21.11. Do not silently retarget Java25/26.2, claim confirmed26.2 compatibility, or invent a diagnosis. Prefer stable shared APIs when practicable. Document exact deployed-artifact/server-version uncertainty and full trace still needed to diagnose their particular server failure. Fix source-declared defects independently now.
I READ the actual current build.gradle/plugin.yml/manifest.kod, CookieEconomyPlugin, Database, Async, Workflows, PresentationManager, MenuListener, EconomyCommands and MarketService. Startup constructs services then async Database.open; commands/listeners register before ready, presentation starts after DB open, fixed sibling data directory CookieSMPEconomyClean. Current jar Gradle task unpacks runtimeClasspath SQLite3.51.1.0, transitive=false, signatures excluded; manifest sqlite-jdbc. Accidental XMaterial was previously removed. Prior workspace compilation succeeded but NO Paper/database execution was done. Do not confuse compile classpath with declared deploy dependencies. Audit complete import graph for accidental external libraries and deploy classloading, packaged plugin.yml/resources, SQLite service/native/module resources and logging requirements, duplicate jar/dependency download concerns. Ensure a single usable artifact under workspace actual packaging conventions; do not rely on hidden workspace libraries or startup network. Packaging issues must be fixed in source/build config, not merely described.
AUDIT/REPAIR:
- Main lifecycle: exact error logging, no swallowed startup failures, all settings/managers/listeners/executors initialize in safe order, commands before DB ready refuse safely including console/autocomplete, absent YAML keys use safe defaults. Ready state and config access safe even failed startup. Shutdown handles partial startup, waits for DB safely, rejects new work, closes connections, cancels tasks/GUI/scoreboard/tab, callbacks don't run after disable. Review Async.run acceptance/executor.execute races, single-thread connection ownership, scheduling failures, callback exceptions and in-flight lock cleanup. No blocking worker/main-thread dependency deadlocks or unbounded retries/query flooding.
- All commands/aliases/plugin.yml match exact methods; parse invalid/quoted args helpfully, permissions enforced on every handler and GUI path, admin console support, no alias bypass. UUID known-offline handling, no fake accounts or blocking remote name resolution. No namespace hijacks of other plugins.
- Money uses safe exact cents/BigDecimal, robust bound checks/overflow, no invalid/negative/NaN/infinite/zero transactions, same formatting. Atomic ledger/debit/credit, unique action IDs, no credit on failed debit. Starting funds only once. Check every SQL parameter order/query/schema index/constraint/prepared statement and transaction rollback/autocommit handling (nested transactions if any), no UPDATE with accidental zero rows accepted. No data resets, additive versioned migrations and before-migration backups incl WAL consistency. Newer schemas fail closed.
- Shop/currency/item operations: correct actual inventory capacity with metadata/max-stack constraints, live prices, stale confirmations, repeated legitimate purchases without close, cancelled/failed purchase no charge or items. No double-spend/delivery with async callbacks or quick relog/quit. Inventory snapshots don't overwrite changed unrelated slots. Audit saveData/remove/add order and persistent reservation journal recovery semantics. No promises of perfect ACID across SQLite and Minecraft player saves; fail closed on genuinely ambiguous crash state with documented admin review. Normal recoverable failures must compensate once rather than needlessly destroy items/money. Mailbox supports partial fits/restarts/quit/exception; no replay of possibly delivered items, no silent discard or automatic unsafe refunds.
- Sell GUI/hand/all/inventory uses storage only as specified, unsellable remainder retained, normal material-only sale protects custom items; worth same live prices, real chronological sell histories including order sales. Smart Sell strictly higher matching orders first, equal/lower normal, fill next orders/remaining normal, metadata exact, no own-order fills, include valid order-only items. Revalidate inventory/order/prices at commit, exact arithmetic/capacity, atomic escrow/order remaining/mailbox/seller/history. Never pay twice or leave taken items unaccounted for.
- AH list/search/history, real metadata serialization, cancellation/expiry/mailbox seller returns, conditional purchase claim, offline seller payment, no self-buy or double sale. Orders upfront escrow creation, owned cancellation unused refund exactly once, delivery exact templates/partial/offline buyer mailbox/join delivery and remaining persistent. Bounties multi contributions, cancellation only caller contribution, valid attributable PvP kills (not environmental fall after prior hit), cooldown anti-farming persistent, no self-funded killer payout/repeated death payout. Collection Book persistent registration/stats/GUI/rewards exact once; daily cooldown reward exact once with timestamp + credit atomic; events honest configured info.
- Every typed GUI owner/session/generation/action-token map: shift/drag/double click/hotbar/offhand/collect/drop/creative click exploits, decorative icons never become purchasable/free items, permission checks even stale open GUI, clean closes/quit/reload. Menus cannot strand currency/inventory on stale requests. Pagination stable and practical, not title-based authorization.
- New sidebar/tab: real stats/economy, async balance snapshot bounded single-inflight, no Bukkit operations off main, late results isolated by session/revision, no fake starting balance, player map cleanup, no task duplication on reload, presentation failure cannot kill economy. Independent toggles, yield to external sidebar/tab, restore only own state, do not override other plugin player-list names/teams. Review compatibility calls against actual1.21.11 API. Avoid destructive scoreboard replacement to unrelated plugins.
NONNEGOTIABLE SHOP/STYLE REQUIREMENTS TO PRESERVE:
New shop starts EMPTY: shipped shop.categories:{}; never seed/autocreate categories on any startup/reload/item-add; preserve all existing saved user categories/items/prices. /shop category add "PvP" "totem_of_undying" creates an empty USER-SELECTED name/icon, /shop add "PvP" totem_of_undying 1.5k adds ONE totem priced1500 into EXISTING category; missing category fails with helpful create instruction. Both cookiesmp.shop.admin default op, console works, user-defined quoted names supported. Category IDs safe (no YAML injection), duplicate/ambiguous names rejected, chosen icon honored (even feather if explicitly chosen). Shop-only k/m/b exact suffix parser cannot weaken other amounts; duplicate material upsert behavior clear, no deleting unrelated variants. /sell missing [page], /sell set "item" price cookiesmp.sell.admin default op continue to work. All config writes share one gate, validate candidate then atomic file move then publish immutable Settings; preserve external unrelated configuration settings, no memory/disk mismatch on failure or lost concurrent reload/set/category/item writes. Generation invalidates stale prices, immediate usability. Test by reasoning/source inspection only (do not create tests).
Orange Cookie SMP branding, centered paginated54-slot category menus, clean empty background, footer controls, readable item-price lore; no default category icons added, COOKIE for theme feather navigation only, normal item textures unchanged. Configurable actual sidebar/tab based on previous screenshot descriptions, preserve current orange layout.
FORBIDDEN absolutely: player warps/pw, Jobs/jobs, player-to-player Trading/trade, Recycler/recycler or replacements; no commands/menu/classes/dependencies/listeners. Keep Collection Book and all other requested systems. No unrelated new commands/feature scope.
DELIVERY/ARTIFACT IDENTIFICATION:
After actual concrete fixes, use patch release1.0.1 in Gradle/version banner/docs with a distinguishable deploy jar CookieSMPEconomy-1.0.1.jar; plugin name/data directory must NOT change (preserve database/config). Remove hardcoded1.0.0 archive name/banner drift, align generated descriptor sources jar filenames/README artifact paths. Keep old data untouched, no automatic legacy import, warn not to install both old/new economy jars. Do not tell user to delete data or reset DB. Do not claim the shown error fixed without its cause.
Create/update REPAIR_REPORT.md with concrete discovered defects, implemented fixes and affected files, static reasoning checks, command/permission list, expected artifact path, truly unresolved issues and data migration/recovery behavior. Update README/IMPLEMENTATION_REPORT consistently. Clearly separate previous successful workspace compilation from latest edits pending lead compile, no live Paper/green plugins/DB init/restart/native loading/gameplay/exploit tests executed. Do not ask user to write/run tests. Return concise code fixes, remaining concerns and exact expected deploy jar. If something cannot be fixed safely without missing info, report precise blocker instead of faking working code or silently changing behavior.
Audit lifecycle, packaging and database execution, then repair concrete startup/shutdown defects.
Audit transaction, inventory, command and GUI flows while preserving saved data and current shop behavior.
Review presentation coexistence, release as
1.0.1, and document fixes and unresolved deployment evidence.
The audit found concrete lifecycle issues: an executor submission/shutdown race, uncapped read requests, indefinitely retried system actions, and incomplete cleanup after failed SQLite initialization. Those are being repaired; the partial server trace still does not establish why the older-named JAR failed to load.
The focused repairs now cover queue limits, reconnect-safe mailbox/collection work, recovery reconnect protection, atomic configuration editing, and auction cancellation with durable item return. Existing schema/data and the empty-by-default shop are retained. I’m finishing the 1.0.1 repair report and artifact-identification notes; no build or runtime checks have been run.
Completed the source audit and focused repairs as CookieSMPEconomy 1.0.1.
Repaired executor/shutdown races, rollback handling and queue/retry limits.
Fixed mailbox/collection reconnect handling and protected queued recovery from reconnect races.
Strengthened atomic config writes, command/completion gates and GUI failure handling.
Added owned auction cancellation with durable item returns.
Hardened sidebar/tab coexistence and JDBC packaging configuration.
Added
REPAIR_REPORT.md; updated README and implementation report.
Existing clean config, data directory and schema are preserved. Old project untouched.
Expected deploy JAR: build/libs/CookieSMPEconomy-1.0.1.jar
These edits await fresh workspace compilation. No builds, tests or live-server checks were run. The reported loading failure remains undiagnosed without its full exception chain; its trace referenced Paper 26.2, while this plugin remains targeted to 1.21.11 / Java 21. Native JDBC loading also remains unverified.
IMPORTANT: The uploaded image is ONLY a visual example and inspiration for the rank badge design. Do not copy it exactly. Use it as a general reference for the style, colors, pixel-art appearance and 3D effect. Create your own original, polished design that fits the COOKIE SMP server. The final result should look even more professional and unique.
--- 📎 Attached 1 file(s):
File: pasted-code-1794640196912.txt
# COOKIE SMP — EXISTING PLUGIN EXTENSION
I want you to EXTEND my EXISTING Minecraft Paper plugin. Do NOT create a separate plugin.
## IMPORTANT
- Keep the existing plugin name, main class, plugin.yml, commands, features, database and configuration.
- Do not remove, replace or break any existing functionality.
- Add all new features below directly into the existing plugin.
- Inspect the uploaded plugin JAR and source project before making changes.
- If source code is missing, explain what is needed to safely extend the plugin. Do not pretend that editing a compiled JAR alone is equivalent to modifying its source.
- Target Paper 26.2 and Java 25.
- Use Maven and SQLite if compatible with the existing project.
- All player-facing messages must be in English.
- Integrate with the existing Cookie and Shard economy systems. Never create duplicate currencies or modify existing economy data.
- Inspect the real economy API and use verified methods only.
- Preserve existing player data and database compatibility.
- Do not rewrite existing systems just to add new features.
- Reuse existing classes, utilities, APIs and configuration wherever possible.
- All new features must work together with the existing plugin.
## RANKS
Add:
- `/rank create <id> <name>`
- `/rank delete <id>`
- `/rank set <player> <rank>`
- `/rank remove <player>`
- `/rank temp <player> <rank> <duration>`
- `/rank info <player>`
- `/rank list`
- `/rank prefix <rank> <prefix>`
- `/rank permission <rank> <permission>`
- `/rank home <rank> <max_homes>`
- `/rank cookie <rank> <seconds>`
- `/rank vanish <rank>`
Support:
- Custom prefixes and colors.
- Custom rank permissions.
- Rank inheritance.
- Temporary rank expiration.
- Rank display in chat, tab list and scoreboard.
- Rank-based home limits.
- Rank-based AFK Shard reward intervals.
- Rank-based vanish access.
- Persistent rank assignments and settings.
### RANK VISUAL DESIGN — PREMIUM BADGE
I have uploaded a reference image showing a Minecraft rank badge with the text PREMIUM.
Use this image as the visual reference for the appearance of rank prefixes and rank badges.
The desired style:
- Minecraft pixel-art appearance.
- Rectangular badge/nameplate.
- Bright gold/orange border.
- Dark outer outline and shadow.
- Bold, highly readable pixel-style lettering.
- Slight 3D/beveled appearance.
- Premium-looking Minecraft server design.
- Text positioned centrally inside the badge.
- Strong contrast between the lettering and background.
The PREMIUM rank should be capable of matching the uploaded reference image as closely as technically possible.
Allow every rank to have its own configurable:
- Badge color.
- Border color.
- Text color.
- Prefix.
- Visual style.
Apply the rank appearance consistently in chat, tab list and other supported interfaces.
If ordinary Minecraft text cannot reproduce the exact image appearance, support custom resource-pack font glyphs or another compatible solution. Without a resource pack, use the closest possible text-based fallback.
Do not pretend that ordinary Minecraft text can display an actual image.
Do not delete or reset existing ranks while adding this visual system.
Do not create default ranks if none exist.
## HOMES AND WARPS
Add:
- `/sethome <name>`
- `/home <name>`
- `/homes`
- `/delhome <name>`
- `/setwarp <name>`
- `/warp <name>`
- `/warps`
- `/delwarp <name>`
- `/spawn`
- `/setspawn`
Requirements:
- Persist locations.
- Enforce rank-based home limits.
- Support multiple homes per player according to rank.
- Check destination safety.
- Respect protections.
- Start with no automatically created homes or warps.
## RTP
Add `/rtp` with an Overworld, Nether and End GUI.
Requirements:
- Generate a new random safe location each time.
- Add `/overworldborder <size>`, `/netherborder <size>` and `/endborder <size>`.
- These commands configure RTP search limits, not Minecraft world borders.
- Respect world borders, claims and WorldGuard.
- Avoid unsafe locations such as lava, dangerous terrain and unsuitable spawn locations.
- Do not change the actual Minecraft world border.
## TELEPORTS
Add:
- `/tpa`
- `/tpahere`
- `/tpaccept`
- `/tpdeny`
- `/tpcancel`
- `/back`
Requirements:
- Use a configurable 5-second countdown by default for RTP, TPA, homes, spawn, warps and back.
- Cancel if the player moves or takes damage.
- Check destination safety and protections.
- Prevent teleport exploits.
- Handle disconnects safely.
## VANISH
Add:
- `/vanish`
- `/tptp <player>`
Requirements:
- Only ranks authorized through `/rank vanish <rank>` can use vanish.
- Hide players from normal players, including tab list and entity visibility.
- Preserve vanish through teleport and reconnect.
- `/tptp` allows vanished staff to teleport while remaining hidden.
- Ensure vanished players are not accidentally revealed by other plugin features.
## AFK
Add:
- `/afk`
- `/afkset`
- `/afkset <minutes>`
- `/afkset reset`
- `/afkcheck <player>`
- `/afkzoneset`
Requirements:
- Detect inactivity automatically.
- Support manual AFK.
- Support configurable AFK zones.
- Display AFK status in chat and tab.
- Award Shards only inside configured AFK zones using `/rank cookie <rank> <seconds>` and the existing Shard API.
- Prevent duplicate rewards and exploits.
- No rewards unless configured.
- Persist relevant AFK data safely.
## COOKIE TOOLS
Add Cookie Drill and Cookie Shovel.
Give ONLY through:
`/cookie give <item> <player>`
Requirements:
- Drill mines configurable 3x3 areas.
- Shovel digs configurable 3x3 areas.
- Configure durability, cooldowns and allowed blocks.
- Optional Shovel expiration after exactly 7 real-world days.
- Persist expiration timestamps.
- Show remaining lifetime in lore.
- Expired tools become unusable.
- Use unique PDC IDs.
- Respect protections.
- Prevent duplicate drops, XP exploits and item duplication.
- Normal tools must remain unaffected.
## SPECIAL SPAWNERS
Add configurable special types such as:
- `zombiespawner`
- `skeletonspawner`
Give ONLY through:
`/cookie give <spawner> <player>`
Requirements:
- Spawn real mobs.
- Same-type special spawners stack into one block.
- Example: 1 spawner = 1 mob/minute; 20 stacked = 20 mobs/minute.
- Configure spawn interval and stack limit.
- Display stack count.
- Show information on right-click.
- Persist counts.
- Prevent exploits and duplication.
- Natural vanilla dungeon, mineshaft and other spawners must never stack, convert or interact with special spawners.
- Preserve vanilla behavior.
- Identify special spawners using unique PDC IDs.
## COOKIE SHOP
Add:
- `/cookieshop add <cookie_price>`
- `/cookieshop remove <id>`
- `/cookieshop list`
- `/cookieshop reload`
Requirements:
- Add the exact item held in the admin's MAIN HAND.
- Preserve all metadata, names, lore, enchantments, attributes, flags and components.
- Price per one item.
- Prevent duplication.
- Start empty.
- Use the existing Cookie API.
## SHARD SHOP
Add:
- `/shardshop`
- `/shardshop add <item_id> <price>`
- `/shardshop remove <id>`
- `/shardshop list`
- `/shardshop reload`
Requirements:
- Start empty.
- Use the existing Shard API.
- Do not add `/spawnershop`.
- Prevent duplication and transaction exploits.
## SELL
Add `/sell see`.
Requirements:
- Display all items with configured selling prices.
- Hovering over inventory items shows the price in lore where supported.
- Prices are always per ONE item, never an entire stack.
- Show actual configured prices.
- Items without configured prices have no selling price.
- Do not modify the original items.
## TEAMS
Add:
- `/team create`
- `/team invite`
- `/team accept`
- `/team deny`
- `/team leave`
- `/team kick`
- `/team disband`
- `/team info`
- `/team list`
- `/team top`
- `/team online`
- `/team promote`
- `/team demote`
- `/team transfer`
- `/team sethome`
- `/team home`
- `/team chat`
- `/team ally`
- `/team unally`
- `/team friendlyfire`
- `/team colour`
- `/team bank`
- `/team stats`
Requirements:
- Support Leader, Co-Leader, Officer and Member roles.
- Invitations with expiration.
- Role-based permissions.
- Private chat.
- Alliances.
- Team homes.
- Team statistics.
- Optional shared Cookie bank using the existing economy API.
- Start with no teams.
- Prevent unauthorized team actions.
## ANNOUNCEMENTS
Add `/announcement <message>`.
Requirements:
- Send a large centered title announcement to all online players.
- Support long messages.
- Configurable colors and duration.
- Permission: `cookiesmpextras.announcement`.
- No automatic announcements.
- Never translate or modify the administrator's message.
## SCOREBOARD
Update or extend the existing scoreboard with:
Title: `COOKIE SMP`
Display:
- Player
- Rank
- Cookie balance
- Kills
- Deaths
- Team
- Playtime
- Ping
Requirements:
- Use green, gold, yellow, aqua and white only.
- Never use red.
- Update automatically without flickering.
- Use the real Cookie balance.
- Preserve existing scoreboard functionality where possible.
- Do not create duplicate scoreboard systems.
## PLAYER STATS
Add:
- `/stats [player]`
- `/playtime`
- `/ping`
- `/seen <player>`
Display:
- Rank.
- Kills.
- Deaths.
- Playtime.
- Team.
- First join.
- Last seen.
- Ping.
Persist data.
## PLUGIN PROTECTION
Block `/plugins`, `/pl` and `/bukkit` for normal players.
Requirements:
- Allow authorized admins only.
- Do not interfere with unrelated commands or plugin functionality.
- Prevent command namespace bypasses where possible.
## ADMIN
Add:
- `/cookiesmpextras`
- `/cookiesmpextras info`
- `/cookiesmpextras reload`
Requirements:
- Granular permissions.
- Safe configuration reload.
- Useful diagnostic information.
- Never lose stored data during reload.
# CRATE SYSTEM — NEW FEATURE
Add a complete customizable crate system directly into the existing plugin.
This must be integrated with the existing plugin architecture. Do not create a separate plugin or separate economy.
## CRATE COMMANDS
Add:
`/crate create <name>`
Creates a new crate with the specified ID/name.
`/crate add <name>`
Adds the exact item currently held in the administrator's MAIN HAND to the specified crate's reward list.
Requirements:
- Preserve the complete original item.
- Preserve custom names, lore, enchantments, attributes, flags, components and all other item metadata.
- Allow multiple different items in one crate.
- Each added item becomes an individual selectable reward.
- Do not replace custom items with generic materials.
- Reject empty hands and invalid items.
`/crate key give <crate> <player>`
Gives the specified player a key for that crate.
Support an optional amount argument if appropriate.
`/crate colour set <crate> <color>`
Sets the visual color of the selected crate and its matching key.
`/crate remove <name>`
Removes a crate definition with suitable confirmation.
`/crate list`
Lists configured crates.
`/crate preview <name>`
Displays all rewards in the selected crate.
`/crate reload`
Reloads crate configuration safely without deleting stored data.
Add an administrator command to bind a physical chest to a crate, for example:
`/crate set <name>`
The administrator targets a chest and binds it to the specified crate.
Also add:
`/crate unset`
Removes the plugin crate binding from the targeted chest.
You may add other necessary administrative commands, but preserve the requested commands and their functionality.
## CRATE APPEARANCE
Every physical crate must look like a normal Minecraft chest.
Requirements:
- Use a chest block as the physical crate.
- Display the crate's name using its configured color.
- Make the name clearly visible above or on the chest using a compatible Minecraft mechanism, such as a hologram or supported custom name display.
- Different crate types must have different configurable colors.
- Make registered crates recognizable as plugin crates.
- Normal Minecraft chests must remain unaffected.
- Protect registered crate blocks from unauthorized breaking, opening, or modification.
- Store crate identity safely.
- Support multiple physical locations for the same crate type.
Do not replace the physical chest with an unrelated block or custom model.
## CRATE COLORS
Support Minecraft color names and hex colors where technically possible.
Examples:
- GOLD
- YELLOW
- RED
- BLUE
- AQUA
- GREEN
- PURPLE
- WHITE
- DARK_PURPLE
The crate name, chest label and key must all use the same configured color.
When an administrator changes the crate color using `/crate colour set`, update the appearance of all physical crates belonging to that crate type and all subsequently generated keys.
## CRATE KEYS — COLORED CANDLES
Each crate must have its own unique key.
The key must be a Minecraft candle item.
Requirements:
- Use the candle color matching the configured crate color.
- The candle must have the Mending enchantment.
- If normal Minecraft candle items do not support enchantments, implement the enchantment display and item metadata using the appropriate Paper API mechanism while retaining the candle as the actual item.
- Add a custom display name identifying the crate.
- Add descriptive lore explaining which crate the key opens.
- Use PersistentDataContainer to identify the key and its exact crate ID.
- A key belonging to one crate must never open another crate.
- Normal candles must never count as keys.
- Prevent forged keys and duplication.
- Support configurable key amounts.
- Consume exactly ONE valid key per successful crate opening.
- Do not consume a key when the crate is invalid, empty, or opening is cancelled.
The candle color must match the crate color.
## OPENING A CRATE
When a player holds the correct key and RIGHT-CLICKS the matching physical crate chest:
1. Check that the targeted chest is a registered plugin crate.
2. Check that the player holds a valid crate key.
3. Check that the key belongs to the exact targeted crate type.
4. Check that the crate contains at least one reward.
5. Check that the player is allowed to open the crate.
6. Consume exactly one valid key.
7. Open the custom crate reward GUI.
Normal chests must not trigger this system.
## CRATE GUI — PLAYER CHOOSES THE REWARD
This is extremely important:
I do NOT want a random reward system.
When a player opens a crate, display a custom inventory GUI containing all available rewards.
The player must be able to CHOOSE which item they want.
Requirements:
- Show the actual configured reward items.
- Preserve all item metadata.
- Allow the player to select exactly ONE reward.
- Give the selected reward to the player.
- Close the GUI after successful selection.
- A single key must allow exactly one reward selection.
- Prevent selecting multiple rewards with one key.
- Prevent shift-clicking, dragging, number-key swapping, double-clicking and other inventory exploits.
- Players must not be able to directly take display items from the GUI.
- Players must not be able to insert their own items into the GUI.
- The GUI must not allow access to the crate's internal data.
- If the player's inventory is full, safely deliver the reward without losing it.
- If a crate has no rewards, do not consume the key and do not open the GUI.
- Prevent duplication through disconnects, server restarts, inventory manipulation or repeated clicks.
- Make the GUI visually clear and easy to use.
The reward must be chosen by the player, not randomly selected by the plugin.
A crate can contain many rewards, but the player chooses ONE of them.
## CRATE DATA AND PERSISTENCE
Persist:
- Crate IDs and names.
- Crate colors.
- Reward item data.
- Physical crate locations.
- Key identifiers.
- Any other data needed for safe operation.
Requirements:
- Data must survive server restarts.
- Reload must not delete crate definitions or rewards.
- Use the existing database/configuration architecture wherever possible.
- Do not modify unrelated player data.
- Prevent duplication and item loss.
- Start with no automatically created crates or rewards.
- Never overwrite existing configuration.
## CONFIGURATION
Add or extend:
- `config.yml`
- `messages_en.yml`
- `ranks.yml`
- `homes.yml`
- `rtp.yml`
- `teleport.yml`
- `afk.yml`
- `tools.yml`
- `spawners.yml`
- `shardshop.yml`
- `cookieshop.yml`
- `teams.yml`
- `announcements.yml`
- `scoreboard.yml`
- `warps.yml`
- `crates.yml`
Requirements:
- Never overwrite existing configurations or player data.
- Merge new settings safely.
- Preserve all existing settings.
- Add clear comments.
- Validate configuration values.
- Start shops, teams, ranks, warps, crates and rewards empty or disabled unless already configured.
- Do not create default crate contents.
- Do not reset existing ranks.
## TECHNICAL REQUIREMENTS
- Use UUIDs.
- Use PersistentDataContainer for custom items and special blocks.
- Use SQLite and the existing architecture where compatible.
- Add permissions, validation and tab completion.
- Persist all new data across restarts.
- Prevent duplication, exploits and item loss.
- Respect WorldGuard and supported claim plugins.
- Avoid conflicts with existing commands and plugins.
- Keep database operations safe.
- Do not block the main server thread with unnecessary database operations.
- Use compatible Paper 26.2 APIs and Java 25.
- Keep all new systems compatible with existing plugin functionality.
## DELIVERY
Return:
1. The COMPLETE updated source project.
2. The updated compiled plugin JAR.
3. Updated configuration files.
4. Installation instructions.
5. Migration instructions if necessary.
6. A list of all added commands.
7. A list of all permissions.
8. A test report.
Test every new command, permissions, economy integration, rank expiration, AFK rewards, vanish, teleport countdowns, tools, spawner stacking, natural spawners, shops, teams, announcements, scoreboard, stats, crate creation, crate rewards, crate keys, crate colors, crate GUI selection, item persistence, full inventory handling and restart persistence.
Do not claim tests passed unless they were actually performed.
Fix bugs before delivery.
No placeholders or unfinished features.
MOST IMPORTANT: This is an upgrade to my existing plugin, not a new standalone plugin. Preserve all existing features and data. Add the requested crate system and rank visual improvements directly into the existing plugin without breaking anything.

Extend the existing source and database in place, and update the target to Paper 26.2 / Java 25 as requested.
Add ranks, safe teleport systems, teams, AFK, tools, special spawners and player statistics.
Add persistent choose-one crates and empty configurable shops, reusing the existing GUI and recovery architecture.
Integrate rank/AFK presentation, permissions, configuration and documentation without replacing the current economy.
The source contains one cents-based economy, but no separate Cookie or Shard API. I won’t invent those balances or silently map currencies. Currency-dependent features will fail closed until an explicit, verified integration is available. I can support text badges and supplied font glyphs, but cannot generate a resource pack here.
The extension now has persistent rank/team state, safe teleport countdowns, signed custom items, special-spawner reservations, and choose-one crate entitlements. Crate choices survive closing the menu or disconnecting; rewards use the existing mailbox rather than direct unjournaled inventory grants.
Cookie shop purchases can use the existing economy only through an explicit administrator binding. Shard payouts/purchases and the optional Cookie team bank remain blocked by the missing currency API, rather than creating substitute balances.
The new commands, configuration files and lifecycle hooks are integrated into the existing plugin. I also added a current-Paper metadata-index refresh for active buy orders: it preserves the original item templates and escrow while rebuilding matching keys for the requested version upgrade.
I’m documenting the migration and recovery boundaries now. The supplied source is editable, but no plugin JAR was available to compare against the deployed artifact. No compilation or runtime test result is being claimed.
Extended the existing plugin as 1.1.0, targeting Paper 26.2 / Java 25. Plugin identity, main class and clean data directory remain unchanged.
Added:
Persistent ranks, inheritance, temporary assignments, permissions and configurable text/font-glyph badges.
Homes, administrator warps/spawn, RTP, TPA/back, vanish, AFK and player statistics.
Role-controlled teams, private chat, alliances and optional shared banking.
Cookie tools, protected special spawners and
/sell see.Choose-one crates with exact reward metadata, authenticated candle keys, chest labels and persistent reward claims/mailbox delivery.
Currency limitation: no separate Cookie/Shard API exists in the supplied source. Cookie checkout/banking require explicit binding to the original economy. Shard purchases and AFK Shard payouts remain disabled pending the actual API—no substitute currencies were created.
Commands, permissions, installation, migration and limitations are documented in EXTENSION_REPORT.md and README. TEST_REPORT.md honestly records no compilation or runtime tests performed.
Expected JAR: build/libs/CookieSMPEconomy-1.1.0.jar
Generate it with Compile → Compile → Download. Phone: ⋮ → Compile Project → Compile → Download.
Badges currently use text fallback or supplied font glyphs—not embedded images. Original artwork generation can be enabled in Settings → Generation; Studio is available to all users.
package com.cookiesmp.clean;
import com.cookiesmp.clean.command.AdminCommand;
import com.cookiesmp.clean.command.CommunityCommands;
import com.cookiesmp.clean.command.EconomyCommands;
import com.cookiesmp.clean.command.MarketCommands;
import com.cookiesmp.clean.command.SellCommands;
import com.cookiesmp.clean.gui.MenuListener;
import com.cookiesmp.clean.gui.MenuSession;
import com.cookiesmp.clean.gui.Menus;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.command.TabExecutor;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.logging.Level;
public final class CookieEconomyPlugin extends JavaPlugin {
private Settings settings;
private long generation = 1;
private boolean ready;
private Database database;
private Async async;
private EconomyRepository economy;
private MarketRepository marketRepository;
private CommunityRepository communityRepository;
private Workflows workflows;
private SellService sells;
private MarketService markets;
private CommunityService community;
private Menus menus;
private ConfigManager configManager;
private PresentationManager presentation;
private com.cookiesmp.clean.extras.Extras extras;
private List<String> materials;
private boolean expiryInFlight;
@Override public void onEnable() {
try {
database = new Database();
async = new Async(this);
getLogger().info("Loading " + getFile().getName() + " | target Paper 26.2 / Java 25 | server " + Bukkit.getVersion() + " | JVM " + Runtime.version());
if (!Bukkit.getMinecraftVersion().equals("26.2")) getLogger().warning("This server is not the declared Minecraft 26.2 target. Compatibility with this server version is unverified.");
Path directory = getDataFolder().toPath().resolveSibling("CookieSMPEconomyClean");
Files.createDirectories(directory);
Path config = directory.resolve("config.yml");
if (!Files.exists(config)) {
try (InputStream resource = getResource("config.yml")) {
if (resource == null) throw new IllegalStateException("Packaged config.yml resource is missing.");
Files.copy(resource, config);
}
}
settings = Settings.load(config);
materials = Items.materials().stream().map(Enum::name).toList();
economy = new EconomyRepository(database);
marketRepository = new MarketRepository(database, economy);
communityRepository = new CommunityRepository(database, economy);
workflows = new Workflows(this);
sells = new SellService(this);
markets = new MarketService(this);
community = new CommunityService(this);
menus = new Menus(this);
configManager = new ConfigManager(this, config);
presentation = new PresentationManager(this);
extras = new com.cookiesmp.clean.extras.Extras(this, database, directory);
register(new EconomyCommands(this), "balance", "pay", "baltop", "shop");
register(new SellCommands(this), "sell", "worth", "sellhistory");
register(new MarketCommands(this), "ah", "order");
register(new CommunityCommands(this), "bounty", "collection", "rewards", "daily", "events");
register(new AdminCommand(this), "cookieeconomy");
register(extras, com.cookiesmp.clean.extras.Extras.COMMANDS.toArray(String[]::new));
Bukkit.getPluginManager().registerEvents(new GameListener(this), this);
Bukkit.getPluginManager().registerEvents(new MenuListener(this), this);
Bukkit.getPluginManager().registerEvents(presentation, this);
extras.registerListeners();
async.run(() -> { database.open(directory.resolve("economy.sqlite")); return extras.load(directory); }, (opened, error) -> {
if (error != null) { fatal("SQLite initialization failed; no gameplay actions enabled", error); return; }
try { extras.install(opened); }
catch (Exception failure) { fatal("Extension configuration initialization failed; existing data retained", failure); return; }
async.reserved(() -> { extras.finishInitialization(); return true; }, (indexed, indexError) -> {
if (indexError != null) { fatal("Existing order metadata indexes could not be prepared for this Paper version", indexError); return; }
ready = true;
for (org.bukkit.entity.Player player : Bukkit.getOnlinePlayers()) workflows.join(player);
try { extras.start(); }
catch (RuntimeException extensionError) { getLogger().log(Level.SEVERE, "Extension scheduling failed; original economy remains available", extensionError); }
try { presentation.start(); }
catch (RuntimeException presentationError) { getLogger().log(Level.SEVERE, "Presentation startup failed; economy remains available", presentationError); }
Bukkit.getScheduler().runTaskTimer(this, () -> {
if (expiryInFlight) return;
expiryInFlight = true;
Settings captured = settings;
async.run(() -> { marketRepository.expire(captured); return true; }, (expired, failure) -> {
expiryInFlight = false;
if (failure != null) getLogger().log(Level.SEVERE, "Market expiry failed; inspect the complete database cause and durable state", failure);
});
}, 20L, 1200L);
getLogger().info("Cookie SMP Economy " + getPluginMeta().getVersion() + " initialized. Data: " + directory.toAbsolutePath() + ". No legacy import was performed.");
});
});
} catch (Exception | LinkageError error) { fatal("Economy initialization failed", error); }
}
private void register(TabExecutor executor, String... names) {
for (String name : names) {
PluginCommand command = getCommand(name);
if (command == null) throw new IllegalStateException("Missing plugin.yml command: " + name);
command.setExecutor(executor);
command.setTabCompleter(executor);
}
}
private void fatal(String message, Throwable error) {
ready = false;
getLogger().log(Level.SEVERE, message, error);
Bukkit.getPluginManager().disablePlugin(this);
}
@Override public void onDisable() {
ready = false;
try { if (extras != null) extras.stop(); }
catch (RuntimeException error) { getLogger().log(Level.SEVERE, "Could not finish extension cleanup", error); }
try {
if (presentation != null) presentation.stop();
} catch (RuntimeException error) { getLogger().log(Level.SEVERE, "Could not finish presentation cleanup", error); }
try {
Bukkit.getScheduler().cancelTasks(this);
for (org.bukkit.entity.Player player : Bukkit.getOnlinePlayers()) {
try {
if (player.getOpenInventory().getTopInventory().getHolder() instanceof MenuSession) player.closeInventory();
} catch (RuntimeException error) { getLogger().log(Level.WARNING, "Could not close menu for " + player.getUniqueId(), error); }
}
} finally {
if (async != null && database != null) async.shutdown(database, () -> {
if (workflows != null) workflows.drainReservations();
});
}
}
public Settings settings() { return settings; }
public long generation() { return generation; }
public boolean ready() { return ready; }
public Async async() { return async; }
public EconomyRepository economy() { return economy; }
public MarketRepository marketRepository() { return marketRepository; }
public CommunityRepository communityRepository() { return communityRepository; }
public Workflows workflows() { return workflows; }
public SellService sells() { return sells; }
public MarketService markets() { return markets; }
public CommunityService community() { return community; }
public Menus menus() { return menus; }
public ConfigManager configManager() { return configManager; }
public List<String> materials() { return materials; }
public com.cookiesmp.clean.extras.Extras extras() { return extras; }
public void replaceSettings(Settings replacement) {
PresentationSettings previous = settings.presentation();
settings = replacement;
generation = Math.incrementExact(generation);
if (presentation != null && !previous.equals(replacement.presentation())) {
try { presentation.reload(); }
catch (RuntimeException error) { getLogger().log(Level.SEVERE, "Presentation reload failed; configuration is saved and economy remains available", error); }
}
}
}