Use strict number format for the /pay command
Information
This PR is related to #5495. The issue actually contains two issues, so can't say PR fixes it.
Details
Proposed fix:
Enforces more strict number format for the pay command. The difference with the #5496 approach is that this one also fixes cases like 12m34.56, which I don't think should be allowed. This also fixes the issue with inputs like 123.456.789 - previously Ess was just swallowing the NumberFormatException and was showing untranslated exception message to the player.
Environments tested:
OS: Linux Mint 21.2
Java version: openjdk 17.0.8 2023-07-18 LTS
- [x] Most recent Paper version (1.20.1, git-Paper-171)
- [ ] CraftBukkit/Spigot/Paper 1.12.2
- [ ] CraftBukkit 1.8.8
Demonstration:
Changed the Pattern to avoid nonsense like 1_'_,,'_`'.1. Something like 1,2_3`4'.5 still feels a bit wrong, but I think it's better worked on in https://github.com/EssentialsX/Essentials/issues/2355 with international (or configurable) decimal/thousands separators standards support in mind.