Add Coal Cents economy

This commit is contained in:
CoalGov Deploy
2026-05-04 17:00:05 +00:00
commit c8cc200004
73 changed files with 6873 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
====== Coal-backed Economy ======
CoalGov uses Coal Cents for sub-coal transactions. Balances are stored as integer cents, cannot go negative, and display as coal plus ''cc'' when needed. 100cc equals 1 coal.
===== Conversion =====
* 1 coal item = 100cc.
* 1 coal block = 900cc when deposited.
* Plain command amounts are coal, so ''2.5'' means 2 coal 50cc.
* A ''cc'' suffix enters cents directly, so ''75cc'' means 75 Coal Cents.
* Withdrawals always return coal items, not coal blocks, and must be whole-coal amounts.
===== Player Balances =====
Each player has one balance stored by UUID in SQLite. A player row is created automatically when they join the server.
===== Deposits =====
Players run:
/coal deposit
The plugin scans the player inventory, removes all enabled deposit items, and credits the account. By default, both COAL and COAL_BLOCK are accepted.
===== Withdrawals =====
Players run:
/coal withdraw <amount>
The command fails if the amount is not positive, the amount is not whole coal, the balance is too low, or the inventory lacks space.
===== Payments =====
Players run:
/coal pay <player> <amount>
The target player must be online. Payments accept whole coal, decimal coal, or a ''cc'' suffix. The transfer is recorded in the transactions table.
===== Fines =====
Players can inspect and pay unpaid fines:
/coal fines
/coal fines pay <id>
/coal fines pay all
Paid fines go into the government treasury.
===== Resource Market =====
Players run:
/market
The market lets players sell configured resources for coal or Coal Cents and buy stacks from Ministry stock. Prices are dynamic: scarce resources cost more, oversupplied resources pay less, and market stock persists in SQLite.
Market purchases and sales can charge a configured government tax. Tax-exempt players do not pay transaction tax.
===== Treasury =====
The treasury receives market transaction tax and paid fines. Admins can inspect the treasury and issue treasury-funded grants.
===== NPC Economic Agents =====
CoalGov NPCs have their own coal accounts and inventory. Trader NPCs buy and sell from their own stock and balance. Worker NPCs move inside an assigned polygon zone and periodically produce configured goods into their own inventory.
===== Transactions =====
CoalGov records deposits, withdrawals, player payments, admin grants, admin takes, permit purchases, claim purchases, land sales, market sales, market purchases, market refunds, fine payments, and treasury grants in the transactions table.