EssentialsX

EssentialsX

2M Downloads

Optionally disable fractional payments

EhhChris opened this issue ยท 1 comments

commented

Feature request

Feature description
Adding a configurable option in the EssentialsEco section that disallows users from paying each other with fractional amounts, allowing only whole numbers for the /pay command.

How the feature is useful
The new configuration would allow for more flexible use of EssentialsEco as an economy management system.

As an example, the system I am trying to achieve is allowing players to virtually 'store' diamonds 1-to-1 as their economy balance, with a custom deposit command being the only way to 'generate' new balances that can then in turn be used with other plugins such as ChestShop or with the essentials-native pay command. Without disallowing fractional payments in essentials I'll need to disable the pay command as an option to prevent users from having what would essentially be digital dust that cannot be equated to a single diamond.

While I'm aware my example is fairly specific to my use-case, there are scenarios that this feature would fit the general user-base of EssentialsX. For example, while there is an option to enforce a minimum pay amount, and a server owner could set this to '1', this does not prevent a user from using /pay to send 1.00001- creating a useless trailing amount in two users account balances that does not likely fit any useful economy feature on the server.

Yes, this was previously suggested
This feature was previously suggested in #275 but closed without much constructive discussion. This is a fairly simple feature that expands the flexibility of Essentials as an economy replacement, and would like it to be reconsidered. If the issue is marked as 'open to PR' I'll go ahead and make the effort myself.

commented

Sounds totally reasonable to me personally. If you make the PR, I would suggest implementing more broadly, where you can configure how many decimal places payments are to be rounded to. In your case where you want whole numbers, this would be zero. However, I could see many people who want to use this for designating cents (2 decimal places) or something else.

Just FYI, the "open to PR" tag is not required for you to make a PR. I'd say it's mostly intended as a marker for aspiring or interested contributors. Feel free to go ahead and make it.