FlashyReese / CommandAliases

Alternate short commands for complex commands
MIT License
25 stars 6 forks source link

Failure to register aliases for mod-added commands on startup. #34

Closed John-Paul-R closed 2 years ago

John-Paul-R commented 2 years ago

(I believe) Due to this command registration change, it is now possible for CommandAliases to load aliases before other mods have registered their commands, which will cause the registration process to fail for any CommandAliases nodes that reference one of these not-yet-registered commands.

Repro:

{
  "commandMode": "COMMAND_REDIRECT",
  "redirectCommand": {
    "command": "h",
    "redirectTo": "essentialcommands home tp"
  }
}
[SERVER] COMMAND_REDIRECT - Could not find existing command "essentialcommands home tp".
FlashyReese commented 2 years ago

The registration callback is earlier for Command Aliases because of the mod id I presume. If I revert back this breaks all commands when using /reload for datapacks.

I'm not sure how to tackle this issue, if someone knows a way to get around this without having both issues appear feel free to PR.

John-Paul-R commented 2 years ago

Alright, I've put up a PR with a possibly way to resolve this. Not sure I particularly like the approach, but I think it should work. Still need to do some local testing. (#35)