Goal
Make the ChestShop sales tax tunable, as requested by the DemocracyCraft Department of Commerce and Congress. Today every player-shop sale pays one flat rate (TAX_AMOUNT, 2.5% on DC) and admin-shop sales pay SERVER_TAX_AMOUNT. ChestShop sets the rate and Treasury's TaxApi collects it into DCGovernment.
Two additions are requested:
1. Rate by the receiver's balance (brackets)
The balance of whoever receives the money (the shop owner on a buy, the player on a sell-to-shop) picks the sales tax rate, e.g. 0% under $1k, 1% from $1k, 2% from $5k. When unset, TAX_AMOUNT applies as today. Admin-shop sales keep SERVER_TAX_AMOUNT.
2. Per-item multipliers
Scale whichever rate applies by item, e.g. netherite ×2, capped at 100%. Items are identified by:
- custom item id first (Nexo and other custom-item plugins, e.g.
nexo:<id>)
- then the ChestShop item code
- then the vanilla material, which must not match a custom item built on that material (a custom item made from paper is not taxed as PAPER)
Constraints
- Off by default, with no behaviour change until configured. Tunable on
/chestshop reload, and a bad entry warns rather than breaking reload.
- Custom item detection must rely on known custom-item tags, not on any text a plugin happens to store on an item. Otherwise vanilla items tagged by enchant or stats plugins escape the material multiplier.
- The balance used for a bracket must be the receiver's balance before this sale, correct even when several sales to the same owner settle at once.
Open policy questions (for Commerce/Congress)
- Flat vs marginal: with flat brackets, crossing a floor raises the rate on the whole sale ($4,999 pays 1%, $5,000 pays 2%). Is that intended?
- Avoidance: only the receiving account's balance is looked at, so a seller can drop a bracket by parking money in a firm account or an alt before selling. Is that acceptable, or should the bracket use the player's combined holdings (or the sale size) instead?
- Bracket floors/rates and the initial multiplier list.
Acceptance
- Brackets and multipliers work for player shops, firm (business) shops and sell-to-shop. Admin shops are unchanged.
- Covered by unit tests: bracket edges, empty/invalid config, custom vs vanilla item matching, the 100% cap.
- Admin ChestShop config docs describe the new keys, and correct the old note that
TAX_AMOUNT is inert (it isn't: DC runs 2.5%).
- Rates published for the explorer taxation page, if in scope (PAR-80/PAR-92).
Related: PR #52 (a proposed implementation from a community contributor).