Closed dualspiral closed 8 years ago
Wow! Nice job on this! I'm going to read through it, test it, etc. Thanks for the help! :smile:
@dualspiral Hello. I am happy to say I am beginning to start the modularization update. I would like your help, especially with using the command system you wrote for the plugin, please let me know if you've got some spare time and can lend a hand :smile:
@hsyyid - I've pinged you in #spongedev but I don't think you're there at the moment! Let me know when we can have a chat, I think your ideas need to be fleshed out before code is put down. This will be a very big task and may need a lot of changes.
@dualspiral refer to #13 for general structure that planned out early on. Would love some opinion on that. Either that or we can actually make each module its own repository...
In order to allow for EssentialCmds to be more modular, and to group command code together, a CommandLoader has been introduced that loads the commands. This command loader can be extended to selectively register commands in the future.
This should help with any work on https://github.com/hsyyid/EssentialCmds/issues/18, which seems to miss making commands modular!
The
CommandExecutorBase
containsgetAliases()
for the command names,getSpec()
gets theCommandSpec
, andgetAssociatedModules()
will provide a way to associate a command with a set of modules - though no modules have been assigned. This last method is designed to be scanned within theCommandLoader
to choose whether to load a command or not.Some commands use the
AsyncCommandExecutorBase
, which runs the command on an async thread, keeping some tasks off the main thread.Some sub commands have been merged into the original base commands. Some other commands have had minor touch ups/fixes to use newer Sponge features (just as I saw them).
In particular: /r has been rationalised to reuse /m code, and a new TimespanParser has been added for /mute, and could be useful for /tempban and any other time limited commands.