Hey So I'm recoding this large project of mine, and I want to make it cleaner to read and understand in general.
Currently All my sub commands are in my command class like.
It gets messy because of all the sub commands in the class, that class alone has 2100 lines its just messy and a pain to navigate through.
I searched google on how to do this and I keep finding that its something called abstraction. I looked at some of the first page google results after searching how to make sub commands in separate classes. No luck (Don't get it) So I looked at this
https://www.tutorialspoint.com/java/java_abstraction.htm I still don't really understand how to go about making a "Command Handler" thingy so I can have my main command in 1 class then all my sub commands in other classes.
Any Help on how I would do this is much appreciated
Currently All my sub commands are in my command class like.
PHP:
@Override
public void onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(cmd.getName().equalsIgnoreCase("CommandHere")) {
if(args.length == 0) {
//DO STUFF
}
if(args.length == 1) {
//DO STUFF
}
}
}
It gets messy because of all the sub commands in the class, that class alone has 2100 lines its just messy and a pain to navigate through.
I searched google on how to do this and I keep finding that its something called abstraction. I looked at some of the first page google results after searching how to make sub commands in separate classes. No luck (Don't get it) So I looked at this
https://www.tutorialspoint.com/java/java_abstraction.htm I still don't really understand how to go about making a "Command Handler" thingy so I can have my main command in 1 class then all my sub commands in other classes.
Any Help on how I would do this is much appreciated
