Unable to edit config with /hps config edit for numeric values
jacklin213 opened this issue ยท 0 comments
Effects all OS, versions of Spigot, all recent versions of HPS
Describe the bug
When trying to edit any configuration using the /hps config edit command, if the desired value to set is a number, it gets written to the config as a string which causes errors.
To Reproduce
Steps to reproduce the behavior:
- Run any command to edit a config and provide a numeric value
eg)/hps config edit spell spells.arania-exumai.knockback 2
- Try casting the spell
- See error in console
Additional Info
Issue is likely due to how Command handlers will convert all arguments into strings.
For the example provided above, currently is set into config like below:
HarryPotterSpells/src/com/hpspells/core/command/GeneralCommand.java
Lines 45 to 51 in 0cddaef
Will need to detect if
args[3]
is numeric (int, float, double) and write it to config correctly