📄
builder_economy_max_spec_COMPLETE.txt
txt
797 lines
▶
BUILDER ECONOMY PLUGIN – COMPLETE & FINAL DEV SPEC
(All gaps from original filled. Zero ambiguity. Ready to code.)
========================================
SECTION 1: CORE SYSTEM DESIGN
========================================
A large-scale builder economy plugin designed for Minecraft servers.
Primary mechanics:
- Players earn money through item selling
- Players buy land (chunk-based)
- Land can be owned solo or shared (2–8 players)
- Ownership share is strictly contribution-based
- Land value fluctuates dynamically
- Land can be traded, auctioned, reclaimed
- No hard limits on land ownership
========================================
SECTION 2: ARCHITECTURE (FOR DEVELOPERS)
========================================
MAIN MODULES:
- EconomyManager
- ClaimManager
- ShareManager
- PricingEngine
- GUIManager
- AuctionManager
- TaxManager
- DataManager
- CommandManager
DATA STORAGE:
- YAML (config)
- JSON/YAML (runtime data)
FILES:
config.yml
biomes.yml
shop.yml
tax.yml
prices.yml
messages.yml
data/prices.yml
data/claims.yml
data/players.yml
========================================
SECTION 3: ECONOMY SYSTEM
========================================
Integration: Vault API required
Currency: $
Expected balance: 300k–600k per day average income
========================================
SECTION 4: COMPLETE SHOP SYSTEM (FULL ITEM LIST)
========================================
All items registered by Material enum (Bukkit).
Sell-only shop (players sell to server, server does not sell to players).
Pricing formula per item:
sell_price = base_category_price × rarity_modifier
BASE CATEGORY PRICES:
Common: $40
Natural: $50
Wood: $80
Stone: $70
Decorative: $120
Rare: $250
Premium: $400+
------------------------------------------
CATEGORY: FARMING
------------------------------------------
ITEM BASE_PRICE RARITY_MOD SELL_PRICE
WHEAT 40 1.0 40
WHEAT_SEEDS 40 0.5 20
CARROT 40 1.0 40
POTATO 40 1.0 40
BEETROOT 40 1.0 40
BEETROOT_SEEDS 40 0.5 20
PUMPKIN 50 1.0 50
MELON_SLICE 40 1.0 40
MELON 40 2.0 80
SUGAR_CANE 40 1.0 40
CACTUS 40 1.0 40
BAMBOO 40 0.8 32
COCOA_BEANS 50 1.2 60
SWEET_BERRIES 50 1.0 50
GLOW_BERRIES 50 1.5 75
NETHER_WART 50 2.0 100
CHORUS_FRUIT 50 2.5 125
KELP 40 0.8 32
DRIED_KELP 40 1.0 40
SEA_PICKLE 50 1.5 75
LILY_PAD 50 1.0 50
MOSS_BLOCK 50 1.2 60
HANGING_ROOTS 50 1.0 50
SPORE_BLOSSOM 120 1.0 120
BROWN_MUSHROOM 50 1.0 50
RED_MUSHROOM 50 1.0 50
CRIMSON_FUNGUS 50 1.5 75
WARPED_FUNGUS 50 1.5 75
TORCHFLOWER 250 1.0 250
PITCHER_PLANT 250 1.2 300
OPEN_EYEBLOSSOM 250 1.0 250
CLOSED_EYEBLOSSOM 250 1.0 250
------------------------------------------
CATEGORY: MINING
------------------------------------------
ITEM BASE_PRICE RARITY_MOD SELL_PRICE
COAL 40 1.0 40
COAL_ORE 40 1.2 48
DEEPSLATE_COAL_ORE 40 1.5 60
IRON_ORE 70 1.2 84
DEEPSLATE_IRON_ORE 70 1.5 105
RAW_IRON 70 1.0 70
COPPER_ORE 70 1.0 70
DEEPSLATE_COPPER_ORE 70 1.3 91
RAW_COPPER 70 0.8 56
GOLD_ORE 250 1.0 250
DEEPSLATE_GOLD_ORE 250 1.3 325
NETHER_GOLD_ORE 250 1.2 300
RAW_GOLD 250 1.0 250
REDSTONE_ORE 120 1.0 120
DEEPSLATE_REDSTONE_ORE 120 1.3 156
REDSTONE 120 0.5 60
LAPIS_ORE 120 1.0 120
DEEPSLATE_LAPIS_ORE 120 1.3 156
LAPIS_LAZULI 120 0.6 72
DIAMOND_ORE 250 1.5 375
DEEPSLATE_DIAMOND_ORE 250 1.8 450
DIAMOND 250 2.0 500
EMERALD_ORE 250 2.0 500
DEEPSLATE_EMERALD_ORE 250 2.5 625
EMERALD 250 2.5 625
QUARTZ_ORE 120 1.0 120
NETHER_QUARTZ 120 0.8 96
ANCIENT_DEBRIS 400 3.0 1200
NETHERITE_SCRAP 400 4.0 1600
AMETHYST_SHARD 120 1.5 180
AMETHYST_CLUSTER 120 2.0 240
BUDDING_AMETHYST 400 1.5 600
OBSIDIAN 120 1.5 180
CRYING_OBSIDIAN 250 1.0 250
FLINT 40 1.0 40
GRAVEL 40 0.8 32
SAND 40 0.8 32
SANDSTONE 70 1.0 70
RED_SAND 40 1.0 40
RED_SANDSTONE 70 1.0 70
GRANITE 40 1.0 40
DIORITE 40 1.0 40
ANDESITE 40 1.0 40
TUFF 40 1.0 40
CALCITE 40 1.0 40
DRIPSTONE_BLOCK 50 1.0 50
POINTED_DRIPSTONE 50 1.2 60
------------------------------------------
CATEGORY: MOB DROPS
------------------------------------------
ITEM BASE_PRICE RARITY_MOD SELL_PRICE
-- PASSIVE --
LEATHER 40 1.0 40
RAW_BEEF 40 1.0 40
COOKED_BEEF 40 1.5 60
RAW_PORKCHOP 40 1.0 40
COOKED_PORKCHOP 40 1.5 60
RAW_CHICKEN 40 1.0 40
COOKED_CHICKEN 40 1.5 60
RAW_MUTTON 40 1.0 40
COOKED_MUTTON 40 1.5 60
RAW_RABBIT 40 1.2 48
COOKED_RABBIT 40 1.5 60
RABBIT_HIDE 40 1.0 40
RABBIT_FOOT 250 1.0 250
FEATHER 40 1.0 40
EGG 40 0.5 20
INK_SAC 50 1.0 50
GLOW_INK_SAC 120 1.0 120
COD 40 1.0 40
SALMON 40 1.0 40
TROPICAL_FISH 50 1.5 75
PUFFERFISH 50 2.0 100
BONE 40 1.0 40
STRING 40 1.0 40
SLIME_BALL 120 1.0 120
HONEY_BOTTLE 50 1.5 75
HONEYCOMB 50 1.5 75
-- HOSTILE --
ROTTEN_FLESH 40 0.5 20
SPIDER_EYE 50 1.0 50
GUNPOWDER 120 1.0 120
ARROW 40 0.8 32
ENDER_PEARL 250 1.0 250
BLAZE_ROD 250 1.0 250
BLAZE_POWDER 250 0.6 150
MAGMA_CREAM 120 1.0 120
GHAST_TEAR 250 1.5 375
WITHER_SKELETON_SKULL 400 2.0 800
NETHER_STAR 400 10.0 4000
SHULKER_SHELL 400 2.0 800
ELYTRA 400 5.0 2000
TOTEM_OF_UNDYING 400 4.0 1600
TRIDENT 400 3.0 1200
NAUTILUS_SHELL 250 2.0 500
HEART_OF_THE_SEA 400 5.0 2000
SPONGE 250 2.0 500
PRISMARINE_SHARD 120 1.0 120
PRISMARINE_CRYSTALS 120 1.2 144
GOLD_INGOT (piglin drop) 250 1.0 250
PHANTOM_MEMBRANE 250 1.5 375
BREEZE_ROD 400 2.0 800
------------------------------------------
CATEGORY: BLOCKS
------------------------------------------
ITEM BASE_PRICE RARITY_MOD SELL_PRICE
OAK_PLANKS 80 1.125 90
SPRUCE_PLANKS 80 1.125 90
BIRCH_PLANKS 80 1.125 90
JUNGLE_PLANKS 80 1.125 90
ACACIA_PLANKS 80 1.125 90
DARK_OAK_PLANKS 80 1.125 90
MANGROVE_PLANKS 80 1.25 100
CHERRY_PLANKS 80 1.5 120
BAMBOO_PLANKS 80 1.125 90
CRIMSON_PLANKS 80 1.375 110
WARPED_PLANKS 80 1.375 110
STONE 70 1.0 70
COBBLESTONE 70 0.7 49
STONE_BRICKS 70 1.71 120
MOSSY_STONE_BRICKS 70 2.0 140
CRACKED_STONE_BRICKS 70 1.71 120
CHISELED_STONE_BRICKS 70 1.71 120
SMOOTH_STONE 70 1.0 70
DEEPSLATE 70 1.2 84
COBBLED_DEEPSLATE 70 0.9 63
DEEPSLATE_BRICKS 70 2.0 140
DEEPSLATE_TILES 70 2.0 140
BRICKS 70 1.5 105
NETHER_BRICKS 70 2.0 140
RED_NETHER_BRICKS 70 2.2 154
BLACKSTONE 70 1.5 105
POLISHED_BLACKSTONE 70 2.0 140
BASALT 70 1.2 84
SMOOTH_BASALT 70 1.5 105
MAGMA_BLOCK 120 1.2 144
NETHERRACK 40 1.0 40
SOUL_SAND 50 1.5 75
SOUL_SOIL 50 1.2 60
END_STONE 70 2.0 140
END_STONE_BRICKS 70 2.5 175
PURPUR_BLOCK 120 1.5 180
PURPUR_PILLAR 120 1.5 180
GLASS 70 1.0 70
STAINED_GLASS (all) 70 1.2 84
TERRACOTTA 70 1.0 70
GLAZED_TERRACOTTA (all) 120 1.0 120
CONCRETE (all) 70 1.2 84
CONCRETE_POWDER (all) 70 0.8 56
WOOL (all) 80 1.0 80
CARPET (all) 80 0.5 40
SEA_LANTERN 400 1.0 400
GLOWSTONE 250 1.0 250
SHROOMLIGHT 120 1.5 180
LANTERN 120 1.0 120
SOUL_LANTERN 120 1.2 144
JACK_O_LANTERN 120 1.0 120
CANDLE (all) 120 0.5 60
HAY_BLOCK 40 2.0 80
BEE_NEST 250 2.0 500
BEEHIVE 120 1.5 180
BARREL 80 1.5 120
BOOKSHELF 80 2.0 160
CHISELED_BOOKSHELF 120 1.5 180
LECTERN 80 1.5 120
LODESTONE 400 1.5 600
RESPAWN_ANCHOR 400 2.0 800
CRYING_OBSIDIAN 250 1.0 250
REINFORCED_DEEPSLATE 400 2.0 800
SCULK 50 1.0 50
SCULK_CATALYST 400 1.5 600
SCULK_SHRIEKER 400 2.0 800
SCULK_SENSOR 250 1.5 375
CALIBRATED_SCULK_SENSOR 400 1.5 600
------------------------------------------
CATEGORY: REDSTONE
------------------------------------------
ITEM BASE_PRICE RARITY_MOD SELL_PRICE
REDSTONE 120 0.5 60
REDSTONE_TORCH 120 0.5 60
REDSTONE_BLOCK 120 3.0 360
LEVER 70 0.8 56
BUTTON (all types) 70 0.6 42
PRESSURE_PLATE (all) 70 0.8 56
TRIPWIRE_HOOK 120 0.8 96
OBSERVER 120 1.2 144
PISTON 120 1.0 120
STICKY_PISTON 120 1.5 180
DROPPER 120 1.0 120
DISPENSER 120 1.2 144
HOPPER 120 1.5 180
COMPARATOR 120 1.2 144
REPEATER 120 1.0 120
DAYLIGHT_DETECTOR 120 1.0 120
TARGET 120 1.0 120
NOTE_BLOCK 80 1.2 96
TNT 120 1.5 180
SLIME_BLOCK 120 2.0 240
HONEY_BLOCK 120 2.0 240
IRON_TRAPDOOR 120 1.0 120
IRON_DOOR 120 1.0 120
TRAPPED_CHEST 80 1.2 96
LIGHTNING_ROD 120 1.5 180
POWERED_RAIL 120 1.0 120
DETECTOR_RAIL 120 1.0 120
ACTIVATOR_RAIL 120 1.0 120
MINECART 120 1.0 120
CHEST_MINECART 120 1.5 180
HOPPER_MINECART 120 2.0 240
TNT_MINECART 120 2.0 240
========================================
SECTION 5: INVENTORY GUI SYSTEM (FULL SLOT DESIGN)
========================================
INVENTORY SIZE: 54 slots
FILLER: All empty slots = BLACK_STAINED_GLASS_PANE (no display name)
------------------------------------------
MAIN SHOP MENU
------------------------------------------
Title: "§6§lBuilder Shop"
Slot 10 → FARMING (GREEN_WOOL, "§a§lFarming")
Slot 12 → MINING (IRON_PICKAXE, "§7§lMining")
Slot 14 → MOB DROPS (BONE, "§c§lMob Drops")
Slot 16 → BLOCKS (BRICKS, "§e§lBlocks")
Slot 49 → CLOSE (BARRIER, "§4§lClose")
------------------------------------------
FARMING MENU
------------------------------------------
Title: "§a§lFarming Shop"
Items displayed in order from slot 10, left-to-right, top-to-bottom.
Skip filler slots (borders).
Slot 49 → BACK (ARROW, "§7§lBack")
------------------------------------------
MINING MENU
------------------------------------------
Title: "§7§lMining Shop"
Items in order from slot 10. Slot 49 → BACK.
------------------------------------------
MOB DROPS MENU
------------------------------------------
Title: "§c§lMob Drops Shop"
Items in order from slot 10. Slot 49 → BACK.
------------------------------------------
BLOCKS MENU
------------------------------------------
Title: "§e§lBlocks Shop"
Sub-categories selectable via:
Slot 10 → Natural (OAK_LOG)
Slot 11 → Stone (STONE)
Slot 12 → Wood (OAK_PLANKS)
Slot 13 → Decorative (SEA_LANTERN)
Slot 14 → Nether (NETHERRACK)
Slot 15 → End (END_STONE)
Slot 49 → BACK
------------------------------------------
REDSTONE MENU
------------------------------------------
Title: "§c§lRedstone Shop"
Items in order from slot 10. Slot 49 → BACK.
------------------------------------------
SELL INVENTORY GUI (universal sell screen)
------------------------------------------
Title: "§2§lSell Items"
- Player drags items into slots 20–24 (5-slot sell bar)
- Slot 31 → CONFIRM SELL (LIME_DYE, "§aSell for $[amount]")
- Slot 49 → CANCEL (BARRIER)
========================================
SECTION 6: CLAIM SYSTEM (DETAILED FLOW)
========================================
WAND ITEM: GOLDEN_AXE
- Given via /claim wand
- Right-click to select chunks
- Selected chunks highlighted with particle border
STEP FLOW:
1. Player uses wand (right-click on a block)
2. System identifies the chunk the block is in
3. Player can select multiple adjacent chunks (must be contiguous)
4. Connectivity validated server-side (flood fill check)
5. System calculates total chunk count
6. Cost calculated: cost = chunk_count × biome_chunk_price
(uses the most expensive biome if chunks span multiple biomes)
7. Player confirms via INVENTORY GUI (YES/NO)
CLAIM VALIDATION RULES:
- Chunks must be contiguous (no floating islands)
- Cannot overlap existing claims
- Cannot claim spawn-protected chunks (radius defined in config: default 50 blocks)
- Cannot claim chunks in the world border buffer zone (last 10 chunks before border)
------------------------------------------
SHARED CLAIM FLOW
------------------------------------------
1. Host selects land via wand
2. Host opens /claim split to define splits
3. Host invites players via INVENTORY GUI (up to 7 additional players)
4. Invited players receive INVENTORY GUI notification (bell sound + chat message)
5. Host defines contribution split per player ($amount)
6. System validates: sum of all contributions == total cost exactly
7. Confirmation phase: each player sees YES/NO INVENTORY GUI
8. All invited players must confirm within 1 minute
9. If any player rejects → entire deal cancelled, no money taken
10. If all confirm → money deducted, claim registered
EDGE CASES:
- Player leaves server before confirm → auto-removed from deal, deal cancelled
- Timeout (1 min for confirmation phase) → deal cancelled, no penalty
- Invitation expires after 3 minutes if not accepted
- Host disconnects → deal cancelled
========================================
SECTION 7: SHARE SYSTEM (FULL MATH)
========================================
Formula:
share = player_contribution / total_claim_cost
(stored as double, precision to 8 decimal places)
Example:
Total cost: $1,000,000
Player A pays $600,000 → share = 0.6 (60%)
Player B pays $400,000 → share = 0.4 (40%)
SHARE USED FOR:
- Claim value calculation: player_value = total_value × share
- Leaving payout: payout = current_value × share × 0.5 (instant portion)
- Auction payout: payout = final_bid × share
- Market/direct sale payout: payout = sale_price × share
- Deferred payout: deferred = current_value × share × 0.5 (paid on chunk sale/reclaim)
IMPORTANT RULE:
- Permissions are NOT tied to shares
- Permissions are role-based (see Section 13)
========================================
SECTION 8: LEAVING SYSTEM (ADVANCED)
========================================
On leave:
instant_payout = current_chunk_value × player_share × 0.50
deferred_payout = current_chunk_value × player_share × 0.50
CHUNK REMOVAL ON LEAVE:
- System selects random edge chunks proportional to player's share
- Example: player owns 30% of 10 chunks → 3 edge chunks removed
- Edge chunks = chunks on the outer perimeter of the claim
- If removal would split the claim into disconnected parts → select alternate edge chunks to maintain connectivity
DEFERRED PAYOUT:
- Stored in data/players.yml under "deferred_balance"
- Paid automatically when:
a) A removed chunk is sold to another player
b) Remaining owners reclaim the removed chunks
- Deferred balance can be checked via /claim balance
========================================
SECTION 9: RECLAIM SYSTEM
========================================
After a player leaves, remaining owners can buy back the removed chunks.
Formula:
reclaim_price = base_chunk_price × discount_factor
discount_factor = 0.75 (25% discount vs original price)
Example:
Base chunk price in Plains biome: $1,000,000
Reclaim price: $1,000,000 × 0.75 = $750,000
RULES:
- Only current claim owners can reclaim
- Reclaim cost split equally among reclaiming owners (or manually defined)
- Reclaimed chunks are redistributed proportionally based on who paid
- Reclaim triggers the deferred payout to the departed player
========================================
SECTION 10: AUCTION SYSTEM
========================================
AUCTIONABLE:
- Entire claims
- Individual chunks within a claim
AUCTION START:
- All current owners must confirm via INVENTORY GUI (YES/NO)
- If any owner rejects → auction cancelled
- Starting bid = current_claim_value (or chunk_value for chunk auctions)
BID SYSTEM:
min_increment = $100,000
INVENTORY GUI preset buttons:
+$100,000
+$500,000
+$1,000,000
Custom input field also available
RULES:
- Money locked immediately upon bidding (deducted from balance, held in escrow)
- Previous bidder's money returned instantly when outbid
- Auction duration: 10 minutes (configurable in config.yml)
- Auction can be extended by 2 minutes if a bid is placed in the last 60 seconds
- Minimum auction duration: 5 minutes (config)
- Maximum auction duration: 60 minutes (config)
AUCTION END:
- Winning bidder receives ownership
- Payout distributed to previous owners by share percentage
- If no bids → auction expires, ownership unchanged
========================================
SECTION 11: TAX SYSTEM
========================================
TAX RATE:
$1,000 per chunk per tax cycle
Tax cycle: every 24 real-world hours (configurable)
FARM DETECTION (triggers tax evaluation):
- Crop count threshold: ≥ 50 crop blocks in a chunk
- Hopper count: ≥ 3 hoppers in a chunk
- Redstone activity: ≥ 1 active redstone clock detected in chunk (piston/repeater loop)
TAX COLLECTION:
- Auto-deducted from owner's balance at cycle end
- If shared claim: deducted proportionally by share from each owner
- If owner cannot pay → grace period of 24 hours
- After grace period without payment → PENALTY applies
PENALTY:
penalty_amount = owed_tax × 1.20 (+20%)
Applied per missed cycle
After 3 consecutive missed cycles → claim flagged for reclaim vote by server admin
========================================
SECTION 12: BIOME PRICING (FULL TABLE)
========================================
OVERWORLD – HIGH TIER:
Cherry Grove: $4,000,000
Pale Garden: $3,500,000
Old Growth Spruce: $3,200,000
Bamboo Jungle: $3,000,000
Mushroom Fields: $3,000,000
OVERWORLD – MID TIER:
Plains: $1,000,000
Forest: $1,100,000
Jungle: $1,200,000
Birch Forest: $1,100,000
Dark Forest: $1,300,000
Meadow: $1,200,000
Sunflower Plains: $1,100,000
Flower Forest: $1,400,000
Stony Peaks: $1,200,000
Snowy Plains: $900,000
Taiga: $950,000
Snowy Taiga: $950,000
OVERWORLD – LOW TIER:
Swamp: $500,000
Mangrove Swamp: $600,000
Badlands: $450,000
Eroded Badlands: $480,000
Savanna: $400,000
Desert: $380,000
Beach: $350,000
Ocean: $300,000
Deep Ocean: $250,000
River: $200,000
NETHER:
Warped Forest: $3,000,000
Crimson Forest: $2,500,000
Soul Sand Valley: $2,000,000
Nether Wastes: $1,500,000
Basalt Deltas: $1,200,000
END:
End Highlands: $2,500,000
End Midlands: $2,000,000
End Barrens: $1,200,000
Small End Islands: $1,000,000
The End (main): $500,000
DYNAMIC PRICING RULES:
Demand increase: +1% to +3% per day based on purchase frequency
- 1 purchase in 24h → +1%
- 2–4 purchases → +2%
- 5+ purchases → +3%
Demand tracked per biome type (stored in data/prices.yml)
Natural decrease (no purchases): -1% per day
Price floor: base_price × 0.5 (can never drop below 50% of base)
Price ceiling: base_price × 3.0 (can never exceed 300% of base)
DATA FIELDS:
base_price (defined in biomes.yml, never changes)
current_price (runtime, stored in data/prices.yml, updates daily)
========================================
SECTION 13: PERMISSION SYSTEM
========================================
Permissions are role-based and NOT tied to share percentages.
Each claim has a list of owners with assigned roles.
ROLES:
OWNER – Full access (set by default for claim creator / all initial co-owners)
MEMBER – Can build, break, interact, use containers
GUEST – Can interact and use doors/buttons only; cannot build or break
BANNED – Cannot enter claim (teleported out)
DEFAULT ROLE ASSIGNMENT:
- Claim creator: OWNER
- Co-owners who contributed: OWNER
- Players added later: MEMBER (default), can be changed by any OWNER
OWNER PERMISSIONS:
- Build / break
- Open containers (chests, barrels, etc.)
- Use all blocks (furnaces, crafting, etc.)
- Invite/kick players
- Change roles
- Start auctions
- Initiate claim sale
- Add/remove chunks
- Leave claim
MEMBER PERMISSIONS:
- Build / break
- Open containers
- Use all blocks
- Cannot invite/kick or change roles
- Cannot start auctions or initiate sale
GUEST PERMISSIONS:
- Interact with doors, buttons, levers, trapdoors
- Cannot build, break, or open containers
BANNED:
- Immediately teleported to nearest safe location outside claim
- Cannot interact with anything inside
COMMANDS FOR ROLE MANAGEMENT:
/claim role
/claim invite
/claim kick
========================================
SECTION 14: CLAIM VALUE CALCULATION
========================================
Formula:
total_value = chunk_count × current_biome_price
player_value = total_value × player_share
Example:
10 chunks in Plains (current price $1,050,000 after demand increase)
Player A share = 0.6
total_value = 10 × $1,050,000 = $10,500,000
player_value = $10,500,000 × 0.6 = $6,300,000
Multi-biome claims:
value = sum of (chunk_count_per_biome × current_price_for_that_biome)
========================================
SECTION 15: PERFORMANCE RULES
========================================
- All database writes are async (never block main thread)
- Cache chunk ownership in memory (HashMap)
- Cache invalidated on claim create/delete/transfer
- Avoid sync heavy loops in chunk events (use async where possible)
- Batch price updates (run PricingEngine update task once per hour via scheduler)
- Lazy-load player data (load on join, unload on quit)
- Tax calculations run async on a scheduled task (not on player events)
- Auction countdown runs on a BukkitRunnable, not a tight loop
========================================
SECTION 16: COMMANDS
========================================
/claim wand
- Gives player the claim wand (GOLDEN_AXE)
- Permission: builder.claim.wand
/claim add
- Opens INVENTORY GUI to add adjacent chunks to existing claim
- Permission: builder.claim.add
/claim split
- Opens INVENTORY GUI to define contribution splits for shared claim
- Permission: builder.claim.split
/confirm deal
- Confirms pending shared claim deal or auction
- Permission: builder.claim.confirm
/reject deal
- Rejects pending shared claim deal or auction
- Permission: builder.claim.reject
/claim tp
- Teleports owner to their claim
- Usage: /claim tp [claim_id]
- Permission: builder.claim.tp
/claim visit
- Teleports to another player's claim (if allowed)
- Permission: builder.claim.visit
/claim border
- Toggles particle border visualization around your claim
- Permission: builder.claim.border
/auction
- Opens auction browser INVENTORY GUI
- Subcommand /auction start → initiates auction on your claim
- Permission: builder.auction
/claim balance
- Shows player's deferred balance
- Permission: builder.claim.balance
/claim role
- Sets a player's role in your claim
- Permission: builder.claim.role
/claim invite
- Invites a player to join your claim as MEMBER
- Permission: builder.claim.invite
/claim kick
- Removes a player from your claim
- Permission: builder.claim.kick
/claim info
- Shows info about the claim you are standing in
- Permission: builder.claim.info
/claim leave
- Leave a claim you are a member of
- Triggers leaving system (Section 8)
- Permission: builder.claim.leave
/shop
- Opens main shop INVENTORY GUI
- Permission: builder.shop
========================================
SECTION 17: FINAL RULES
========================================
- No claim limit per player
- No inactivity removal (claims persist indefinitely unless manually sold/reclaimed)
- PvP is disabled in all claimed chunks
- Explosions (TNT, Creeper, Ghast) do NOT damage claimed chunks
- Fire spread disabled in claimed chunks
- Mob griefing disabled in claimed chunks (Endermen, Silverfish, etc.)
- Players cannot be teleported out of claimed chunks without owner permission
(exception: /claim kick and BANNED role)
========================================
END OF COMPLETE SPEC
========================================
Planning the architecture before writing any code:
Data layer:
ChunkCoord,ClaimData,PlayerData,AuctionData,PendingDeal,ClaimRoleManagers:
DataManager,EconomyManager,ShopManager,PricingEngine,ClaimManager,ShareManager,AuctionManager,TaxManagerGUI framework (from documentation):
InventoryHandler,InventoryButton,InventoryGUI,GUIManager,GUIListenerGUI implementations:
MainShopGUI,CategoryShopGUI,BlocksShopGUI,BlocksSubCategoryGUI,SellGUI,ClaimConfirmGUI,SharedClaimSetupGUI,SharedClaimConfirmGUI,AuctionBrowserGUI,AuctionBidGUICommands:
ClaimCommand,ShopCommand,AuctionCommandListeners:
ClaimProtectionListener,WandListener,PlayerListener
All 42 files are created. Here’s a summary of what was built:
6 data classes —
ChunkCoord(serializable, with neighbor logic),ClaimData(shares/roles/contributions),PlayerData,AuctionData,PendingDeal(with phase FSM),ClaimRoleenumGUI framework —
InventoryHandler/Button/GUI,GUIManager,GUIListener(with drag event support)10 GUI implementations — Main shop, 5-category paginated shop, blocks sub-categories, sell GUI (live price update, item return on close), claim confirm, shared claim setup, auction browser/bid GUIs
8 managers —
DataManager(async YAML persistence),EconomyManager(Vault),ShopManager(config-driven),PricingEngine(daily demand/supply cycle, floor/ceiling),ClaimManager(contiguity flood-fill, edge-chunk removal, deferred payouts, border particles, deal lifecycle),ShareManager(contribution math),AuctionManager(escrow, time extension, finalization),TaxManager(farm detection, grace periods, penalties)3 commands —
/shop,/auction,/claim(15 subcommands including wand, split, leave, reclaim, role, invite, kick, info, tp, visit, border, balance)3 listeners — Protection (PvP, explosions, fire, mob griefing, banned-role teleport), wand (golden axe chunk selection), player (join/quit lifecycle, custom bid chat input)
Config files —
plugin.yml,config.yml,biomes.yml(all biomes with prices),shop.yml(300+ items across 5 categories with all color variants)
Continue
package com.buildereconomy;
import com.buildereconomy.commands.AuctionCommand;
import com.buildereconomy.commands.ClaimCommand;
import com.buildereconomy.commands.ShopCommand;
import com.buildereconomy.data.PlayerData;
import com.buildereconomy.inventory.gui.GUIListener;
import com.buildereconomy.inventory.gui.GUIManager;
import com.buildereconomy.listeners.ClaimProtectionListener;
import com.buildereconomy.listeners.PlayerListener;
import com.buildereconomy.listeners.WandListener;
import com.buildereconomy.managers.*;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class BuilderEconomy extends JavaPlugin {
private DataManager dataManager;
private EconomyManager economyManager;
private ShopManager shopManager;
private PricingEngine pricingEngine;
private ClaimManager claimManager;
private ShareManager shareManager;
private AuctionManager auctionManager;
private TaxManager taxManager;
private GUIManager guiManager;
// In-memory player data cache: loaded on join, unloaded on quit
private final Map<UUID, PlayerData> playerDataCache = new HashMap<>();
@Override
public void onEnable() {
saveDefaultConfig();
dataManager = new DataManager(this);
economyManager = new EconomyManager(this);
if (!isEnabled()) return;
shopManager = new ShopManager(this);
pricingEngine = new PricingEngine(this);
shareManager = new ShareManager();
claimManager = new ClaimManager(this);
auctionManager = new AuctionManager(this);
taxManager = new TaxManager(this);
guiManager = new GUIManager();
registerListeners();
registerCommands();
getLogger().info("BuilderEconomy enabled successfully.");
}
@Override
public void onDisable() {
// Save all online player data
playerDataCache.values().forEach(data -> dataManager.savePlayerData(data));
// Cancel all border tasks
getServer().getScheduler().cancelTasks(this);
getLogger().info("BuilderEconomy disabled.");
}
private void registerListeners() {
getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
getServer().getPluginManager().registerEvents(new ClaimProtectionListener(this), this);
getServer().getPluginManager().registerEvents(new WandListener(this), this);
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
}
private void registerCommands() {
getCommand("shop").setExecutor(new ShopCommand(this));
getCommand("auction").setExecutor(new AuctionCommand(this));
getCommand("claim").setExecutor(new ClaimCommand(this));
}
public DataManager getDataManager() { return dataManager; }
public EconomyManager getEconomyManager() { return economyManager; }
public ShopManager getShopManager() { return shopManager; }
public PricingEngine getPricingEngine() { return pricingEngine; }
public ClaimManager getClaimManager() { return claimManager; }
public ShareManager getShareManager() { return shareManager; }
public AuctionManager getAuctionManager() { return auctionManager; }
public TaxManager getTaxManager() { return taxManager; }
public GUIManager getGuiManager() { return guiManager; }
public Map<UUID, PlayerData> getPlayerDataCache() { return playerDataCache; }
}