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
IvanCodeslol opened this issue Apr 2, 2024 · 6 comments
Open

Multiple command signatures #99

IvanCodeslol opened this issue Apr 2, 2024 · 6 comments

Comments

@IvanCodeslol
Copy link

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

@IvanCodeslol
Copy link
Author

oh wait this project is abandoned :/

@LichtHund
Copy link
Member

oh wait this project is abandoned :/

What? Where does it say it's abandoned?

@IvanCodeslol
Copy link
Author

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

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

@IvanCodeslol
Copy link
Author

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