Skip to content

[WIP] Extend pricing system to support item-based min and max prices#9

Closed
Copilot wants to merge 1 commit intomasterfrom
copilot/extend-pricing-system-decimal-support
Closed

[WIP] Extend pricing system to support item-based min and max prices#9
Copilot wants to merge 1 commit intomasterfrom
copilot/extend-pricing-system-decimal-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 24, 2025

Plan: Add Item-Based Min/Max Price Support

  • Explore the codebase and understand current pricing logic
  • Add global min-price and max-price to config.yml with decimal support
  • Add per-item price configuration structure to config.yml
  • Create PriceConfig utility class for loading and validating prices
  • Add price formatting utility using BigDecimal
  • Update Settings.java to load global min/max prices
  • Update NewOrderMenu.java to validate prices against min/max
  • Add random price generation with decimal support
  • Update language files with new validation messages
  • Test price validation and formatting
  • Run build to ensure no compilation errors
Original prompt

This section details on the original issue you should resolve

<issue_title>✨ Set up Copilot instructions</issue_title>
<issue_description>Extend the pricing system to support item-based min-price and max-price with decimal values.

Requirements:

  • Support decimal (double / BigDecimal) min-price and max-price per item.
  • Prices must be read from config.yml and support both integer and decimal values.
  • Global min-price and max-price must still exist as fallback defaults.
  • If an item has its own min/max defined, use those values instead of global ones.
  • Validate per-item prices:
    • min-price <= max-price
    • if invalid or missing, fallback to global min/max and log a warning.
  • Do not break existing configs that only define global prices.
  • Random price generation must work with decimal values.
  • Format prices to 2 decimal places when displayed to players.
  • Prefer BigDecimal for all price calculations (Vault economy compatibility).
  • Avoid runtime exceptions caused by malformed config values.

Context:

  • Language: Java
  • Platform: Spigot / Paper Minecraft plugin
  • Config: YAML (config.yml)
  • Economy: Vault

Please provide:

  • Updated config.yml example (global + item-based prices)
  • Java code to load and validate prices
  • Price resolution logic (item override → global fallback)
  • Random decimal price generation implementation
  • Utility method for formatting prices

</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes NotPatch/NOrder#8

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

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.

2 participants