hsyyid / EssentialCmds

EssentialCmds adds useful commands to Minecraft
https://bit.ly/2HPQ9tR
MIT License
31 stars 21 forks source link

Make the command system more modular. #31

Closed dualspiral closed 8 years ago

dualspiral commented 8 years ago

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 contains getAliases() for the command names, getSpec() gets the CommandSpec, and getAssociatedModules() 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 the CommandLoader 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.

hsyyid commented 8 years ago

Wow! Nice job on this! I'm going to read through it, test it, etc. Thanks for the help! :smile:

hsyyid commented 8 years ago

@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:

dualspiral commented 8 years ago

@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.

kinggoesgaming commented 8 years ago

@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...