Closed seeruk closed 2 years ago
Aah that's interesting to know. Is that something that's changed in CommandManager#execute
? The current version of Apoli is still using that method.
E: Just looking, that does make the code a lot simpler too actually... E2: Updated, thanks @eggohito
I don't know much about why the CommandManager#execute
method fails if the command string is prefixed with a forward slash, but it looks like the CommandManager#executeWithPrefix
method essentially skips the forward slash from the first index of the command string using the String#substring
method if the command string has it
Yeah, like you say, if nothing else it makes it easier for people writing origins with the execute command action to get it right first time, whether they include a slash or not.
I recommend using the
CommandManager#executeWithPrefix
method instead of theCommandManager#execute
method, since the latter doesn't support the command string being prefixed with a forward slash (/
), which is an issue regarding backward compatibility (e.g: old datapacks that may be using the command-related action/condition types to execute commands prefixed with a forward slash will not work)