Skip to content

feat(paper): add material item economy provider - #104

Merged
TheSilentPro merged 8 commits into
masterfrom
feat/item-economy-provider
Oct 15, 2026
Merged

TheSilentPro merged 8 commits into
masterfrom
feat/item-economy-provider

Conversation

@TheSilentPro

Copy link
Copy Markdown
Collaborator

Summary

Adds an optional material-backed item economy provider without changing the existing Vault purchase path.

Configuration

enabled: true
provider: item

item:
  match: material
  material: DIAMOND
  singular: Diamond
  plural: Diamonds

prices:
  any-head: 2

Behavior

  • adds provider: item alongside the existing vault provider;
  • requires explicit item.match: material for the initial implementation;
  • supports one globally configured Bukkit material as currency;
  • matches by material only, regardless of item metadata;
  • consumes only normal player storage inventory contents (not armor/offhand/cursor);
  • performs a full availability pass before mutating inventory, so insufficient purchases remove nothing;
  • supports currency spread across multiple stacks;
  • formats prices as 1 Diamond / 2 Diamonds (configurable singular/plural labels);
  • keeps the existing per-head → custom-category → player/category → fallback price precedence;
  • requires whole-number prices for item economy and disables item economy on startup if fractional configured prices exist;
  • rejects fractional prices entered through the existing admin price editors while item economy is active;
  • leaves Vault provider behavior unchanged;
  • automatically works with the existing GUI price lore introduced in feat(paper): display economy prices in head lore #103.

Includes focused unit tests for formatting, whole-number validation, multi-stack withdrawal, and atomic insufficient-funds behavior.

@TheSilentPro
TheSilentPro merged commit 9672c7d into master Oct 15, 2026
5 checks passed
@TheSilentPro
TheSilentPro deleted the feat/item-economy-provider branch October 15, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant