EssentialsX

EssentialsX

2M Downloads

Possible new command framework?

NJDaeger opened this issue ยท 6 comments

commented

I assume this is isn't even going to be considered, but I was thinking about a possible rewrite of the command system? The current one that is in place is old, not necessarily bad, but it could have way more features than what is currently available. I have written command systems before, and I would be pretty interested in writing one for Essentials. Several other developers and I made a command system that uses a command builder to generate a command that is later registered onto the server. (Link here) The system has a cool feature which allows us to specify subcommands to the command being registered. It's still a bit of a WIP, but I've been using it for about a month now and its been working great. I could make something similar to that if wanted. Another system we could use would be an annotation system (like ACF) which I have also made in the past before.

I understand if you don't want to rewrite the entire command system, it would be a monumental task and take lots of time. I just thought I'd throw the idea out there to see if anyone else had opinions or other possible additions!

commented

Closing as this isn't something we're intending to do at this time.

commented

@SupaHam sorry for pinging, but I really wanna hear someones opinion. The factory style I mentioned above is actually in use in a few plugins a little team of developers and I made... This is one of the command classes we have. Do you think something like that would benefit essentials?

commented

I'm not convinced that a rewrite of the command system is particularly beneficial to EssX, though I suppose the current one could be improved in a PR if someone's willing to do it.

commented

Anything specific that you can think of off the top of your head that can be improved?

commented

Everything can be improved, but doesn't need to be improved. Making any unnecessary changes for no specific progress will benefit no one.

For what it's worth, Builder patterns shouldn't be designed like that. Their data should be isolated and not operate on an actual object. After you build these pieces of data (by creating all equivalent fields in the Builder class) you then build to apply all the changes.

commented

Thank you for the feedback! I understand, one thing that I personally think essentials would benefit from would be something like a CommandContext and TabContext that exists in the example I provided above. I guess the reason why we decided to do a builder style was that we wanted to prevent us from doing as many checks as possible. Saves a lot of time and effort in the end!