Super pickaxe mode toggling does not work with single slash
FabianKoder opened this issue ยท 2 comments
Server Implementation
Paper
Server Version
1.18.1
Describe the bug
Toggling the super pickaxe mode does not work - providing any other argument than true
or false
as a parameter to //superpickaxe
results in a InvocationTargetException
.
The same happens when providing a range with e.g. //superpickaxe area 5
To Reproduce
- Just type
//superpickaxe area 5
,//superpickaxe single
, ... (anything that is not a boolean -//superpickaxe true
will work) - Command will fail to run. See screenshot above. No error output in the console.
- E.g. //sp area 5 fails with the error message above, /sp area 5 works. But for toggling, /sp will fail with "No sub-command provided" and //sp works.
Expected behaviour
It is expected that the mode of the super pickaxe toggles.
Screenshots / Videos
No response
Error log (if applicable)
No response
Fawe Debugpaste
https://athion.net/ISPaster/paste/view/eeb37f10618747c19ceef32f9c21ab8e
Fawe Version
2.0.1-SNAPSHOT-69;d3696f9
Checklist
- I have included a Fawe debugpaste.
- I am using the newest build from https://ci.athion.net/job/FastAsyncWorldEdit/ and the issue still persists.
Anything else?
After quick investigation (disclaimer: never looked at the FAWE codebase before) it seems to me that the ToolUtilsCommands class that defines //superpickaxe
more or less overrides the subcommands of SuperPickaxeCommands, as no matter what arguments you provide it always asks for the
superPickaxe
parameter, the toggle state boolean of the util command. As I have no idea of how the command system is implemented, I can't provide further details.I'm testing //superpickaxe area 5
on build 71 at the moment and it works out well.
The toggle is no separate parameter, but the actual command. E.g. you switch between activating and deactivating via //sp
, not by appending true
or false
.
Can you outline again what exactly was not working please?
Alright, just found out how to "work around" this issue. I don't know if that is intended, but it does work by using a single slash.
Toggling only works with //sp
, changing mode only works with /sp
.
E.g. //sp area 5
fails with the error message above, /sp area 5
works. But for toggling, /sp
will fail with "No sub-command provided" and //sp
works.
It seems very weird to me to split the same tool (options) into two separate commands that look like they are the same command.