WIP: Add ServerShop plugin — server-run global market with configurable pricing #2
Reference in New Issue
Block a user
Delete Branch "copilot/add-server-shop-plugin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Standalone server-run shop plugin designed to complement CommunityMarket's player-to-player economy. Uses a large configurable buy/sell spread (default 75%) so players still prefer trading via CommunityMarket.
Plugin architecture (
ServerShop/)ServerShop.javamain class,ShopCommand(/shop,/servershop), Vault economy integration with graceful failurePricingServicewith per-category sell multipliers (sellPrice = buyPrice * 0.25), per-item overrides, buy/sell togglesMainShopGui→CategoryGui(paginated) →ItemDetailGui(quantity selector: ±1/8/16/32, MIN/MAX, buy/sell confirm). Search via chat input →SearchResultsGuiGuiListenerblocks shift-click, number key swap, drag, double-click, off-hand swap.ShopServicere-validates balance and inventory at transaction timeTransactionLoggeren_US.yml+pt_PT.ymlwith{placeholder}system and message cachingResources
prices.yml— 10 categories, ~400 items with sensible default pricesconfig.yml— economy, GUI, sound, logging, and behavior settingsplugin.yml— depends on Vault, registers/shopcommand and 7 permission nodesKey design decisions
ServerShop/— no changes to existing CommunityMarket codepricing.include-special-itemsOriginal prompt
You are an expert Paper/Purpur plugin developer. Build a professional Server Shop / Global Market plugin for Paper/Purpur 1.21.11 using Java 21 and Maven.
Project goal:
This is a server-run market (NOT player-to-player). It exists alongside my player marketplace plugin (CommunityMarket) and must be designed to support it economically by having a large spread between buy and sell prices (so players still prefer selling to other players).
Core concept:
================================================================================
================================================================================
================================================================================
2) GUI-only UX (MUST)
Commands:
/shop(alias/servershop) opens the main GUI.No other required commands for players; all interactions in GUI.
Main GUI:
Category GUI:
Item Detail GUI:
================================================================================
3) Pricing model (MUST)
We want a large gap between buy and sell prices to keep CommunityMarket valuable.
Implement pricing rules:
buyPrice(server sells to player)sellPrice(server buys from player)sellPrice = buyPrice * sellMultiplierwhere multiplier is LOW (e.g., 0.25) — configurable globally and per-category.Important:
================================================================================
4) Item coverage (MUST)
Exclude/handle:
State the decision clearly and make it configurable.
================================================================================
5) Buy and Sell mechanics (MUST)
Buying:
Selling:
Anti-exploit:
================================================================================
6) Configurability (MUST)
Provide
config.ymlwith:💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.