Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple command signatures #99

Open
0xivb opened this issue Apr 2, 2024 · 6 comments
Open

Multiple command signatures #99

0xivb opened this issue Apr 2, 2024 · 6 comments

Comments

@0xivb
Copy link

0xivb commented Apr 2, 2024

Example:

// Getting own balance
@SubCommand("balance")
@Permission("myplugin.balance")
public void balance(CommandSender sender) {
    if(!(sender instanceof Player)) {
        sender.sendMessage(Component.text("Player only command! (Console cannot have balance)"));
        return;
    }

    sender.sendMessage(getBalance((Player) sender));
}

// Getting another player's balance
@SubCommand("balance")
@Permission("myplugin.balance.others")
public void balanceOther(CommandSender sender, Player player) {
    sender.sendMessage(getBalance(player));
}

The different argument signatures would be used by the plugin to find the right method.

This approach would provide a more readable solution compared to doing argument validation manually (and in this case permission validation too).

@0xivb
Copy link
Author

0xivb commented Apr 2, 2024

oh wait this project is abandoned :/

@0xivb 0xivb closed this as completed Apr 2, 2024
@LichtHund
Copy link
Member

oh wait this project is abandoned :/

What? Where does it say it's abandoned?

@0xivb
Copy link
Author

0xivb commented Apr 2, 2024

That's what it looks like - last commit was 2 years ago; and the last commit in your rewrite was 7 months ago.

@0xivb 0xivb reopened this Apr 2, 2024
@LichtHund
Copy link
Member

Hasn't needed any fix and I haven't had much time to add any new feature, but still works fine, still in development.

@0xivb
Copy link
Author

0xivb commented Apr 2, 2024

Would I be optimistic in thinking this would get implemented in the next 6 months?

@LichtHund
Copy link
Member

Well, this feature, was added once, but the thing is that it's quite hard to get it working well, so I had to revert it. It's quite complex to make it work well with the current way it is done. I cannot guarantee it will be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants