bazarmanager27

make the plugin accouding this photo pl name DonutHexa

1 image attached
Kodari AI
KodariAug 29 at 5:05 am 11
DonutHexa
A Minecraft plugin that adds hexagonal donut-shaped arenas with dynamic gameplay mechanics. Players enter a hexagonal arena structure with a central hole, creating a ring-shaped battleground. The plugin manages arena creation, player teleportation, game states, and win conditions. Features include configurable arena sizes, player count limits, and automatic game start/end sequences. Players compete in PvP battles within the hexagonal ring, with the last player standing declared the winner. The plugin provides commands for arena setup, game management, and player statistics tracking.
  1. Core economy and interactive leaderboard

  2. Category shop and protected purchases

  3. Teleport requests with acceptance and warm-up

  4. Auctions with secure listing purchases

  5. Persistent homes with a home-selection GUI

Built DonutHexa, a DonutSMP-inspired Paper plugin with:

  1. Persistent Hexa economy, /balance, admin balance grants, and /baltop GUI.

  2. Click-to-buy shop GUI with carrots, pearls, diamonds, and Totems.

  3. /tpa, /tpahere, accept/deny handling, movement-cancelled teleport warmup.

  4. Persistent player homes with /sethome, /home, /homes, and /delhome.

  5. Auction GUI with /ah, /ah sell <price>, secure purchases, seller payouts, and expiry.

bazarmanager27

--- 📎 Attached 1 file(s):

File: pasted-code-1787982356545.txt

txt
I need you to build an ORIGINAL, production-quality Minecraft Shop system inspired by the general gameplay flow and usability of modern DonutSMP-style shops.

IMPORTANT:
Do not copy proprietary source code, exact GUI layouts, branding, assets, configurations, or resource files from any existing plugin.

Instead, understand the FUNCTIONAL BEHAVIOR described below and implement it as an original system.

==================================================
SHOP SYSTEM GOAL
==================================================

The shop is a fast, simple, inventory-based marketplace.

The main player flow should be:

/shop
   ↓
Main Shop Menu
   ↓
Select Category
   ↓
Browse Items
   ↓
Select Item
   ↓
Buy or Sell
   ↓
Choose Quantity
   ↓
Confirm Transaction
   ↓
Receive Item or Money
   ↓
Return to Shop

The shop should feel extremely easy to use.

Players should NOT need complicated commands to buy items.

Everything important should be accessible through Minecraft inventory GUIs.

==================================================
1. MAIN SHOP MENU
==================================================

Command:

/shop

When the player runs /shop:

Open a clean inventory GUI called:

SHOP

The main menu should contain category icons.

Example categories:

- Blocks
- End
- Nether
- Gear
- Food
- Farming
- Mining
- Mob Drops
- Redstone
- Special Items
- Shards / Premium Currency

Each category must have:

- Unique ID
- Display name
- Minecraft item icon
- CustomModelData support
- Custom lore
- Configurable slot
- Permission
- Enabled/disabled status

Example configuration concept:

category:
  id: end
  display-name: "END"
  material: END_STONE
  slot: 13
  enabled: true

The main GUI must be completely configurable.

Support:

- GUI title
- Size
- Category positions
- Decorative items
- Sounds
- Icons
- Lore
- Permissions

==================================================
2. CATEGORY NAVIGATION
==================================================

When the player clicks a category:

Example:

END

Open:

SHOP - END

The player should now see all items belonging to that category.

Example END items:

- End Stone
- Ender Pearl
- Chorus Fruit
- Purpur Block
- Shulker Shell
- Totem of Undying

Example NETHER items:

- Blaze Rod
- Nether Wart
- Glowstone
- Magma Block
- Ancient Debris
- Obsidian

Every category can have unlimited items.

Support multiple pages.

Example:

SHOP - NETHER
Page 1/3

Navigation:

Previous Page
Next Page
Back to Categories

==================================================
3. ITEM DISPLAY
==================================================

Every shop item must display useful information.

Example:

DIAMOND

Buy Price: $500
Sell Price: $250

Currency: Money

Left Click:
Buy

Right Click:
Sell

Shift + Left Click:
Buy Stack

Shift + Right Click:
Sell Stack

The exact lore must be configurable.

Items can have:

- Buy price
- Sell price
- Currency
- Buy enabled
- Sell enabled
- Permission
- Maximum purchase
- Maximum sale
- Stock settings

==================================================
4. BUYING SYSTEM
==================================================

When a player LEFT CLICKS an item:

Open a quantity selection GUI.

Example:

BUYING DIAMOND

Quantity: 1

[-64] [-16] [-1]

[CURRENT QUANTITY]

[+1] [+16] [+64]

[BUY]

[CANCEL]

The GUI must show live calculations.

Example:

Item:
Diamond

Quantity:
32

Price Per Item:
$500

Total:
$16,000

When the player clicks BUY:

Perform these checks in order:

1. Verify the shop item exists.
2. Verify buying is enabled.
3. Verify the player has permission.
4. Verify stock is available.
5. Verify the player has enough currency.
6. Verify the inventory has enough space.
7. Recalculate the total price.
8. Deduct currency.
9. Remove stock if required.
10. Give the exact item.
11. Save transaction.
12. Update statistics.
13. Play success sound.
14. Send transaction message.
15. Refresh the GUI.

IMPORTANT:

The transaction must be atomic.

Never allow:

- Duplicate purchases
- Double clicking exploits
- Negative prices
- Integer overflow
- Purchasing without money
- Receiving items twice
- Buying unavailable stock

==================================================
5. QUICK BUY
==================================================

Support quick purchasing.

Example interactions:

SHIFT + LEFT CLICK

Buy one full stack.

If the item stack size is 64:

Buy 64 items.

Before completing:

Calculate:

64 × Buy Price

Example:

Diamond:
$500 each

64 × $500

Total:
$32,000

Check balance and inventory space.

If successful:

Give 64 Diamonds.

==================================================
6. SELLING SYSTEM
==================================================

RIGHT CLICK an item:

Open the Sell Quantity GUI.

The system should detect how many matching items the player owns.

Example:

SELLING DIAMOND

You Own:
128

Quantity:
64

Sell Price Each:
$250

Total:
$16,000

Controls:

[-64]
[-16]
[-1]

[64]

[+1]
[+16]
[+64]

[SELL]

[CANCEL]

When confirmed:

1. Scan inventory.
2. Verify the player owns the items.
3. Remove the exact quantity.
4. Calculate the exact selling amount.
5. Give currency.
6. Save transaction.
7. Update statistics.
8. Refresh GUI.

==================================================
7. QUICK SELL
==================================================

SHIFT + RIGHT CLICK:

Sell a full stack.

Example:

64 Diamonds

Sell Price:
$250

Player receives:

$16,000

Only remove the items if the complete transaction is valid.

==================================================
8. SELL INVENTORY
==================================================

Add:

/sellall

Also provide a button inside the main Shop GUI.

When used:

Scan the player's inventory.

For every item:

Check:

- Does the item have a configured sell price?
- Is selling enabled?
- Is the item blacklisted?
- Does the item match the shop item?
- Is it a custom item that should not be sold?

Calculate the total.

Show confirmation:

SELL INVENTORY

Sellable Items:
125

Estimated Earnings:
$54,500

[CONFIRM]
[CANCEL]

After confirmation:

Remove only valid sellable items.

Never remove:

- Important custom items
- Unpriced items
- Blacklisted items
- Items with protected metadata

Show a detailed result:

Sold Items:
Cobblestone x64 - $640
Iron Ingot x32 - $3,200
Diamond x16 - $8,000

Total Earned:
$11,840

==================================================
9. MONEY AND CUSTOM CURRENCY
==================================================

The shop must support multiple currencies.

Currency types:

MONEY

SHARDS

CUSTOM

Example item:

TOTEM OF UNDYING

Currency:
SHARDS

Price:
500

Display:

Price:
500 Shards

Before buying:

Check the player's Shard balance.

After buying:

Remove exactly 500 Shards.

The currency system must be abstract.

Do NOT hardcode economy logic directly inside the Shop module.

Create a CurrencyProvider interface.

Example concept:

hasBalance(player, currency, amount)

withdraw(player, currency, amount)

deposit(player, currency, amount)

This allows:

- Vault economy
- Internal economy
- Shards
- Custom currencies

==================================================
10. SHOP CATEGORIES
==================================================

Default categories should be configurable.

Recommended categories:

BLOCKS

END

NETHER

GEAR

FOOD

FARMING

MINING

MOB DROPS

REDSTONE

SPECIAL ITEMS

PREMIUM ITEMS

Each category should support:

- ID
- Name
- Icon
- Slot
- Permission
- Items
- GUI title
- Decorative items

==================================================
11. STACK SIZE HANDLING
==================================================

The system must properly understand Minecraft stack sizes.

Example:

Diamond

Maximum stack:
64

Totem of Undying:

Maximum stack:
1

Do not assume every item stacks to 64.

When buying:

Respect:

Material maximum stack size.

When checking inventory:

Calculate available inventory capacity correctly.

==================================================
12. ITEM IDENTIFICATION
==================================================

This is extremely important.

Do NOT identify items only by:

Material

Support exact item matching.

Consider:

- Material
- Custom name
- Lore
- Enchantments
- CustomModelData
- PersistentDataContainer
- Custom metadata

Example:

Normal Diamond Sword

must NOT be treated the same as:

Custom Diamond Sword

unless explicitly configured.

Prevent players from exploiting item metadata to sell modified items for normal shop prices.

==================================================
13. SEARCH SYSTEM
==================================================

Add a Search button.

When clicked:

Ask the player to type the item name in chat.

Example:

Search:
diamond

Show matching items.

Support:

- Exact matching
- Partial matching
- Case-insensitive matching

Example:

Search:
dia

Results:

Diamond
Diamond Block
Diamond Sword
Diamond Pickaxe

Include:

Clear Search

Back

==================================================
14. FAVORITES SYSTEM
==================================================

Allow players to favorite items.

Interaction:

Middle Click

The item is added to the player's Favorites.

Store favorites permanently.

Favorites GUI:

FAVORITE ITEMS

Features:

- Buy directly
- Sell directly
- Remove favorite
- Pagination

Favorites should store item IDs, not raw inventory objects.

==================================================
15. STOCK SYSTEM
==================================================

Support optional stock modes.

UNLIMITED

Items can always be purchased.

GLOBAL

All players share stock.

Example:

Diamond:

Current:
250

Maximum:
500

PLAYER

Each player has their own purchase limit.

Example:

Player can buy:

64 Diamonds every 1 hour.

Support:

- Automatic restock
- Manual restock
- Restock interval
- Maximum stock
- Out-of-stock messages

==================================================
16. SHOP HISTORY
==================================================

Record transactions.

Store:

Transaction ID
Player UUID
Item ID
Action
Quantity
Price Per Item
Total Price
Currency
Timestamp

Actions:

BUY
SELL

Allow players to view:

/shop history

Show:

Recent purchases
Recent sales
Total spent
Total earned

Admin users can inspect player transactions.

==================================================
17. ADMIN MANAGEMENT
==================================================

Admin commands should include:

/shop reload

/shop open <player>

/shop addhanditem

/shop giveitem <player> <item>

/shop history <player>

Requirements:

- Permission checks
- Reload configuration safely
- Do not corrupt active transactions

==================================================
18. CONFIGURATION
==================================================

Use separate configuration files.

Example:

shop.yml

categories.yml

items.yml

currencies.yml

messages.yml

gui.yml

sounds.yml

Do NOT put thousands of items inside one giant config file if a structured format is better.

Every item should support:

id
material
display-name
lore
buy-price
sell-price
currency
category
buy-enabled
sell-enabled
permission
stock
max-buy
max-sell

==================================================
19. GUI EXPERIENCE
==================================================

The design philosophy should be:

Simple
Fast
Minimal
Easy to understand

A player should understand the shop without reading documentation.

Use:

Clear category icons

Clear Buy/Sell information

Clear price formatting

Consistent navigation

Back button

Close button

Next page

Previous page

Search button

Do not overcrowd the inventory.

The GUI design must be ORIGINAL.

Do not copy exact layouts from any existing server.

==================================================
20. PERFORMANCE
==================================================

Requirements:

- Never block the main server thread.
- Do not query the database on every inventory click.
- Cache shop definitions.
- Cache player favorites when appropriate.
- Use async database operations.
- Validate transactions synchronously and safely.
- Avoid creating unnecessary objects.
- Avoid scanning the entire inventory multiple times.
- Prevent click-spam exploits.

Target:

500+ players

==================================================
21. EVENTS AND API
==================================================

Create public events.

Examples:

ShopBuyEvent

ShopSellEvent

ShopOpenEvent

ShopTransactionEvent

Events should allow cancellation.

Create an API for other plugins.

Example:

ShopAPI.getItem(itemId)

ShopAPI.getCategories()

ShopAPI.buy(player, itemId, quantity)

ShopAPI.sell(player, itemId, quantity)

==================================================
22. TESTING REQUIREMENTS
==================================================

Test:

Buying 1 item

Buying stacks

Buying non-stackable items

Selling items

Selling stacks

Sell inventory

Insufficient money

Insufficient Shards

Full inventory

Limited stock

Out of stock

Double clicking

Spam clicking

Custom item matching

Restart persistence

Database failures

Configuration reload

==================================================
FINAL GOAL
==================================================

Build a complete, modern Minecraft shop system with the same GENERAL usability pattern expected from a polished DonutSMP-style server:

Player opens /shop.

Player sees categories.

Player enters a category.

Player sees items.

Player can quickly buy or sell.

Player can choose quantities.

Transactions are safe.

The GUI is clean and simple.

The system is highly configurable.

The implementation must be ORIGINAL and production-ready.

Do not leave TODO methods.

Do not create fake functionality.

Implement the complete system.
3 images attached
Kodari AI
KodariAug 29 at 5:48 am 21
  1. Replace the basic shop with a configurable category, item, and currency model.

  2. Build the original GUI flow: categories, browsing, search, favorites, quantity confirmation, and sell-all confirmation.

  3. Make purchases/sales atomic, exact-item safe, stock-aware, and persisted with history.

  4. Add player/admin commands, events/API, and configuration files for the shop system.

  1. Rebuilt /shop as an original DonutHexa GUI marketplace with configurable category icons matching the supplied End/Nether/Gear browsing flow.

  2. Added category browsing with pages, search-by-chat, favorites, back/next/previous navigation, and a sell-inventory button.

  3. Added buy/sell quantity menus, quick stack buy/sell, exact ItemStack#isSimilar matching, inventory-capacity checks, overflow-safe price calculations, stock controls, click-spam locking, transaction history, and persistent favorites/stock data.

  4. Added Money/Hexa and Shards currency providers, with configurable currencies, GUI, sounds, messages, categories, and shop items.

  5. Added /sellall, /shop history, plus admin /shop reload, /shop open <player>, /shop addhanditem, and /shop giveitem <player> <id> support.

  6. Added public ShopAPI, ShopOpenEvent, ShopTransactionEvent, ShopBuyEvent, and ShopSellEvent extension points.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
31 1,867
src/main/java/com/donuthexa/DonutHexaPlugin.java
package com.donuthexa;

import com.donuthexa.auction.AuctionManager;
import com.donuthexa.command.DonutCommand;
import com.donuthexa.data.HomeManager;
import com.donuthexa.data.ProfileManager;
import com.donuthexa.gui.GuiListener;
import com.donuthexa.shop.ShopManager;
import com.donuthexa.shop.ShopAPI;
import com.donuthexa.teleport.TeleportManager;
import lombok.Getter;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class DonutHexaPlugin extends JavaPlugin {
    private ProfileManager profileManager;
    private HomeManager homeManager;
    private ShopManager shopManager;
    private TeleportManager teleportManager;
    private AuctionManager auctionManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        profileManager = new ProfileManager(this);
        homeManager = new HomeManager(this);
        shopManager = new ShopManager(this);
        teleportManager = new TeleportManager(this);
        auctionManager = new AuctionManager(this);

        DonutCommand command = new DonutCommand(this);
        ShopAPI.initialize(shopManager);
        register(command, "balance", "baltop", "shop", "sellall", "tpa", "tpahere", "tpaccept", "tpdeny", "sethome", "home", "delhome", "homes", "auction", "donuthexa");
        getServer().getPluginManager().registerEvents(new GuiListener(this), this);
        getServer().getPluginManager().registerEvents(shopManager, this);
    }

    @Override
    public void onDisable() {
        if (profileManager != null) {
            profileManager.save();
            homeManager.save();
            auctionManager.save();
            shopManager.save();
        }
    }

    private void register(DonutCommand command, String... names) {
        for (String name : names) {
            PluginCommand pluginCommand = getCommand(name);
            if (pluginCommand != null) {
                pluginCommand.setExecutor(command);
                pluginCommand.setTabCompleter(command);
            }
        }
    }
}