Selling [HELP] How can I create sub commands in different classes?

Discussion in 'Development Services for Sale - Buy & Sell' started by TheCrystalStar, 1/20/17.

Thread Status:
Not open for further replies.
  1. TheCrystalStar

    TheCrystalStar
    Expand Collapse
    High Risk Status: This user has been flagged as high risk due to one or more reasons

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

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

    [HELP] How can I create sub commands in different classes?
     
    #1 TheCrystalStar, 1/20/17
    Last edited by a moderator: 10/28/24
    • This user is inactive. Hasn't logged into their account in over 60 days.
Thread Status:
Not open for further replies.