apace100 / apoli

MIT License
40 stars 46 forks source link

Updated to 1.19.1, fixing command execution crashes #61

Closed seeruk closed 2 years ago

eggohito commented 2 years ago

I recommend using the CommandManager#executeWithPrefix method instead of the CommandManager#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)

seeruk commented 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

eggohito commented 2 years ago

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

seeruk commented 2 years ago

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.