Commands duplicate when a module is reloaded
fynntimes opened this issue ยท 2 comments
When typing /prison modules disable <module>
followed by /prison modules enable <same module>
, that module's commands are registered twice. What should happen is, when the module is disabled, its commands should be removed from the command map.
The commands are not registered twice. The arguments are. However, the commands are not unregistered, so a larger-scale fix is needed:
- Upon disabling a module, the command should be unregistered from the command map (via hacky reflection) and the command handler. Perhaps the command handler should be changed to allow for module-bound commands.
- During the module's disabled period, the commands should not function. All the module's tasks should be canceled as well.
- Upon enabling a module, the commands are registered normally and from a clean slate.