mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Send more helpful message when /lp is executed without any arguments
This commit is contained in:
parent
fb5925e1e8
commit
f71237ea95
@ -143,8 +143,13 @@ public class CommandManager {
|
|||||||
handleRewrites(arguments, true);
|
handleRewrites(arguments, true);
|
||||||
|
|
||||||
// Handle no arguments
|
// Handle no arguments
|
||||||
if (arguments.size() == 0) {
|
if (arguments.size() == 0 || (arguments.size() == 1 && arguments.get(0).trim().isEmpty())) {
|
||||||
sendCommandUsage(sender, label);
|
CommandUtils.sendPluginMessage(sender, "&2Running &bLuckPerms v" + plugin.getVersion() + "&2.");
|
||||||
|
if (mainCommands.stream().anyMatch(c -> c.shouldDisplay() && c.isAuthorized(sender))) {
|
||||||
|
Message.VIEW_AVAILABLE_COMMANDS_PROMPT.send(sender, label);
|
||||||
|
} else {
|
||||||
|
Message.NO_PERMISSION_FOR_SUBCOMMANDS.send(sender);
|
||||||
|
}
|
||||||
return CommandResult.INVALID_ARGS;
|
return CommandResult.INVALID_ARGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,9 @@ public enum Message {
|
|||||||
*/
|
*/
|
||||||
PREFIX("&7&l[&b&lL&3&lP&7&l] ", false),
|
PREFIX("&7&l[&b&lL&3&lP&7&l] ", false),
|
||||||
|
|
||||||
|
VIEW_AVAILABLE_COMMANDS_PROMPT("&3Use &a/{} help &3to view available commands.", true),
|
||||||
|
NO_PERMISSION_FOR_SUBCOMMANDS("&3You do not have permission to use any sub commands.", true),
|
||||||
|
|
||||||
EMPTY("&c{}", true),
|
EMPTY("&c{}", true),
|
||||||
PLAYER_ONLINE("&aOnline", false),
|
PLAYER_ONLINE("&aOnline", false),
|
||||||
PLAYER_OFFLINE("&cOffline", false),
|
PLAYER_OFFLINE("&cOffline", false),
|
||||||
|
Loading…
Reference in New Issue
Block a user