mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Make command usage output easier to read
This commit is contained in:
parent
6540ffa4dd
commit
c53623dd67
@ -29,7 +29,10 @@ import me.lucko.luckperms.utils.AbstractListener;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.connection.PendingConnection;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.event.*;
|
||||
import net.md_5.bungee.api.event.LoginEvent;
|
||||
import net.md_5.bungee.api.event.PermissionCheckEvent;
|
||||
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
|
||||
|
@ -98,7 +98,7 @@ public abstract class MainCommand<T> {
|
||||
}
|
||||
|
||||
if (sub.getIsArgumentInvalid().test(strippedArgs.size())) {
|
||||
sub.sendUsage(sender, label);
|
||||
sub.sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
@ -146,10 +146,10 @@ public abstract class MainCommand<T> {
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (subs.size() > 0) {
|
||||
Util.sendPluginMessage(sender, "&e" + getName() + " Sub Commands:");
|
||||
Util.sendPluginMessage(sender, "&e" + getName() + " Sub Commands: &7(" + String.format(getUsage(), label) + " ...)");
|
||||
|
||||
for (SubCommand s : subs) {
|
||||
s.sendUsage(sender, label);
|
||||
s.sendUsage(sender);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
package me.lucko.luckperms.commands;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import me.lucko.luckperms.LuckPermsPlugin;
|
||||
import me.lucko.luckperms.constants.Message;
|
||||
@ -42,7 +41,6 @@ import java.util.stream.Collectors;
|
||||
* Abstract SubCommand class
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public abstract class SubCommand<T> {
|
||||
|
||||
/**
|
||||
@ -70,6 +68,14 @@ public abstract class SubCommand<T> {
|
||||
*/
|
||||
private final Predicate<? super Integer> isArgumentInvalid;
|
||||
|
||||
public SubCommand(String name, String description, String usage, Permission permission, Predicate<? super Integer> isArgumentInvalid) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.permission = permission;
|
||||
this.isArgumentInvalid = isArgumentInvalid;
|
||||
this.usage = usage.replace("<", "&8<&7").replace(">", "&8>&7").replace("[", "&8[&7").replace("]", "&8]&7");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this sub command is ran
|
||||
* @param plugin a link to the main plugin instance
|
||||
@ -95,10 +101,9 @@ public abstract class SubCommand<T> {
|
||||
/**
|
||||
* Send the command usage to a sender
|
||||
* @param sender the sender to send the usage to
|
||||
* @param label the command label used
|
||||
*/
|
||||
public void sendUsage(Sender sender, String label) {
|
||||
Util.sendPluginMessage(sender, "&e-> &d" + String.format(getUsage(), label));
|
||||
public void sendUsage(Sender sender) {
|
||||
Util.sendPluginMessage(sender, "&e-> &6" + getName() + (usage.isEmpty() ? "" : "&e - &7" + getUsage()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class GroupAddPrefix extends SubCommand<Group> {
|
||||
public GroupAddPrefix() {
|
||||
super("addprefix", "Adds a prefix to the group", "/%s group <group> addprefix <priority> <prefix> [server] [world]",
|
||||
super("addprefix", "Adds a prefix to the group", "<priority> <prefix> [server] [world]",
|
||||
Permission.GROUP_ADDPREFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class GroupAddSuffix extends SubCommand<Group> {
|
||||
public GroupAddSuffix() {
|
||||
super("addsuffix", "Adds a suffix to the group", "/%s group <group> addsuffix <priority> <suffix> [server] [world]",
|
||||
super("addsuffix", "Adds a suffix to the group", "<priority> <suffix> [server] [world]",
|
||||
Permission.GROUP_ADDSUFFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ import java.util.List;
|
||||
|
||||
public class GroupAddTempPrefix extends SubCommand<Group> {
|
||||
public GroupAddTempPrefix() {
|
||||
super("addtempprefix", "Adds a prefix to the group temporarily", "/%s group <group> addtempprefix <priority> <prefix> <duration> [server] [world]",
|
||||
super("addtempprefix", "Adds a prefix to the group temporarily", "<priority> <prefix> <duration> [server] [world]",
|
||||
Permission.GROUP_ADD_TEMP_PREFIX, Predicate.notInRange(3, 5));
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ import java.util.List;
|
||||
|
||||
public class GroupAddTempSuffix extends SubCommand<Group> {
|
||||
public GroupAddTempSuffix() {
|
||||
super("addtempsuffix", "Adds a suffix to the group temporarily", "/%s group <group> addtempsuffix <priority> <suffix> <duration> [server] [world]",
|
||||
super("addtempsuffix", "Adds a suffix to the group temporarily", "<priority> <suffix> <duration> [server] [world]",
|
||||
Permission.GROUP_ADD_TEMP_SUFFIX, Predicate.notInRange(3, 5));
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,7 @@ import java.util.*;
|
||||
|
||||
public class GroupChatMeta extends SubCommand<Group> {
|
||||
public GroupChatMeta() {
|
||||
super("chatmeta", "Displays a groups chat meta", "/%s group <group> chatmeta", Permission.GROUP_CHATMETA,
|
||||
Predicate.alwaysFalse());
|
||||
super("chatmeta", "Displays a groups chat meta", "", Permission.GROUP_CHATMETA, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,8 +36,7 @@ import java.util.List;
|
||||
|
||||
public class GroupClear extends SubCommand<Group> {
|
||||
public GroupClear() {
|
||||
super("clear", "Clears a groups permissions", "/%s group <group> clear", Permission.GROUP_CLEAR,
|
||||
Predicate.alwaysFalse());
|
||||
super("clear", "Clears a groups permissions", "", Permission.GROUP_CLEAR, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,9 +33,8 @@ import java.util.List;
|
||||
|
||||
public class GroupHasPerm extends SubCommand<Group> {
|
||||
public GroupHasPerm() {
|
||||
super("haspermission", "Checks to see if a group has a certain permission node",
|
||||
"/%s group <group> haspermission <node> [server] [world]", Permission.GROUP_HASPERMISSION,
|
||||
Predicate.notInRange(1, 3));
|
||||
super("haspermission", "Checks to see if a group has a certain permission node", "<node> [server] [world]",
|
||||
Permission.GROUP_HASPERMISSION, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,8 +35,7 @@ import java.util.List;
|
||||
|
||||
public class GroupInfo extends SubCommand<Group> {
|
||||
public GroupInfo() {
|
||||
super("info", "Gives info about the group", "/%s group <group> info", Permission.GROUP_INFO,
|
||||
Predicate.alwaysFalse());
|
||||
super("info", "Gives info about the group", "", Permission.GROUP_INFO, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,9 +33,8 @@ import java.util.List;
|
||||
|
||||
public class GroupInheritsPerm extends SubCommand<Group> {
|
||||
public GroupInheritsPerm() {
|
||||
super("inheritspermission", "Checks to see if a group inherits a certain permission node",
|
||||
"/%s group <group> inheritspermission <node> [server] [world]", Permission.GROUP_INHERITSPERMISSION,
|
||||
Predicate.notInRange(1, 3));
|
||||
super("inheritspermission", "Checks to see if a group inherits a certain permission node", "<node> [server] [world]",
|
||||
Permission.GROUP_INHERITSPERMISSION, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,8 +32,7 @@ import java.util.List;
|
||||
|
||||
public class GroupListNodes extends SubCommand<Group> {
|
||||
public GroupListNodes() {
|
||||
super("listnodes", "Lists the permission nodes the group has", "/%s group <group> listnodes",
|
||||
Permission.GROUP_LISTNODES, Predicate.alwaysFalse());
|
||||
super("listnodes", "Lists the permission nodes the group has", "", Permission.GROUP_LISTNODES, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,8 +32,7 @@ import java.util.List;
|
||||
|
||||
public class GroupListParents extends SubCommand<Group> {
|
||||
public GroupListParents() {
|
||||
super("listparents", "Lists the groups that this group inherits from", "/%s group <group> listparents",
|
||||
Permission.GROUP_LISTPARENTS, Predicate.alwaysFalse());
|
||||
super("listparents", "Lists the groups that this group inherits from", "", Permission.GROUP_LISTPARENTS, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class GroupRemovePrefix extends SubCommand<Group> {
|
||||
public GroupRemovePrefix() {
|
||||
super("removeprefix", "Removes a prefix from a group", "/%s group <group> removeprefix <priority> <prefix> [server] [world]",
|
||||
super("removeprefix", "Removes a prefix from a group", "<priority> <prefix> [server] [world]",
|
||||
Permission.GROUP_REMOVEPREFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class GroupRemoveSuffix extends SubCommand<Group> {
|
||||
public GroupRemoveSuffix() {
|
||||
super("removesuffix", "Removes a suffix from a group", "/%s group <group> removesuffix <priority> <suffix> [server] [world]",
|
||||
super("removesuffix", "Removes a suffix from a group", "<priority> <suffix> [server] [world]",
|
||||
Permission.GROUP_REMOVESUFFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class GroupRemoveTempPrefix extends SubCommand<Group> {
|
||||
public GroupRemoveTempPrefix() {
|
||||
super("removetempprefix", "Removes a temporary prefix from a group", "/%s group <group> removetempprefix <priority> <prefix> [server] [world]",
|
||||
super("removetempprefix", "Removes a temporary prefix from a group", "<priority> <prefix> [server] [world]",
|
||||
Permission.GROUP_REMOVE_TEMP_PREFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class GroupRemoveTempSuffix extends SubCommand<Group> {
|
||||
public GroupRemoveTempSuffix() {
|
||||
super("removetempsuffix", "Removes a temporary suffix from a group", "/%s group <group> removetempsuffix <priority> <suffix> [server] [world]",
|
||||
super("removetempsuffix", "Removes a temporary suffix from a group", "<priority> <suffix> [server] [world]",
|
||||
Permission.GROUP_REMOVE_TEMP_SUFFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,7 @@ import java.util.List;
|
||||
|
||||
public class GroupRename extends SubCommand<Group> {
|
||||
public GroupRename() {
|
||||
super("rename", "Rename this group", "/%s group <group> rename <new name>",
|
||||
Permission.TRACK_APPEND, Predicate.not(1));
|
||||
super("rename", "Rename this group", "<new name>", Permission.TRACK_APPEND, Predicate.not(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,9 +38,8 @@ import java.util.List;
|
||||
|
||||
public class GroupSetInherit extends SubCommand<Group> {
|
||||
public GroupSetInherit() {
|
||||
super("setinherit", "Sets another group for this group to inherit permissions from",
|
||||
"/%s group <group> setinherit <group> [server] [world]", Permission.GROUP_SETINHERIT,
|
||||
Predicate.notInRange(1, 3));
|
||||
super("setinherit", "Sets another group for this group to inherit permissions from", "<group> [server] [world]",
|
||||
Permission.GROUP_SETINHERIT, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,7 +47,7 @@ public class GroupSetInherit extends SubCommand<Group> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,8 @@ import java.util.List;
|
||||
|
||||
public class GroupSetPermission extends SubCommand<Group> {
|
||||
public GroupSetPermission() {
|
||||
super("set", "Sets a permission for a group", "/%s group <group> set <node> <true|false> [server] [world]",
|
||||
Permission.GROUP_SETPERMISSION, Predicate.notInRange(2, 4));
|
||||
super("set", "Sets a permission for a group", "<node> <true|false> [server] [world]", Permission.GROUP_SETPERMISSION,
|
||||
Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,7 +48,7 @@ public class GroupSetPermission extends SubCommand<Group> {
|
||||
String bool = args.get(1).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(node)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ public class GroupSetPermission extends SubCommand<Group> {
|
||||
}
|
||||
|
||||
if (!bool.equalsIgnoreCase("true") && !bool.equalsIgnoreCase("false")) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,7 @@ import java.util.List;
|
||||
public class GroupSetTempInherit extends SubCommand<Group> {
|
||||
public GroupSetTempInherit() {
|
||||
super("settempinherit", "Sets another group for this group to inherit permissions from temporarily",
|
||||
"/%s group <group> settempinherit <group> <duration> [server] [world]",
|
||||
Permission.GROUP_SET_TEMP_INHERIT, Predicate.notInRange(2, 4));
|
||||
"<group> <duration> [server] [world]", Permission.GROUP_SET_TEMP_INHERIT, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -49,7 +48,7 @@ public class GroupSetTempInherit extends SubCommand<Group> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,7 @@ import java.util.List;
|
||||
|
||||
public class GroupSetTempPermission extends SubCommand<Group> {
|
||||
public GroupSetTempPermission() {
|
||||
super("settemp", "Sets a temporary permission for a group",
|
||||
"/%s group <group> settemp <node> <true|false> <duration> [server] [world]",
|
||||
super("settemp", "Sets a temporary permission for a group", "<node> <true|false> <duration> [server] [world]",
|
||||
Permission.GROUP_SET_TEMP_PERMISSION, Predicate.notInRange(3, 5));
|
||||
}
|
||||
|
||||
@ -50,7 +49,7 @@ public class GroupSetTempPermission extends SubCommand<Group> {
|
||||
String bool = args.get(1).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(node)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
@ -60,7 +59,7 @@ public class GroupSetTempPermission extends SubCommand<Group> {
|
||||
}
|
||||
|
||||
if (!bool.equalsIgnoreCase("true") && !bool.equalsIgnoreCase("false")) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class GroupShowTracks extends SubCommand<Group> {
|
||||
public GroupShowTracks() {
|
||||
super("showtracks", "Lists the tracks that this group features on", "/%s group <group> showtracks",
|
||||
Permission.GROUP_SHOWTRACKS, Predicate.alwaysFalse());
|
||||
super("showtracks", "Lists the tracks that this group features on", "", Permission.GROUP_SHOWTRACKS, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,8 +38,8 @@ import java.util.List;
|
||||
|
||||
public class GroupUnSetPermission extends SubCommand<Group> {
|
||||
public GroupUnSetPermission() {
|
||||
super("unset", "Unsets a permission for a group", "/%s group <group> unset <node> [server] [world]",
|
||||
Permission.GROUP_UNSETPERMISSION, Predicate.notInRange(1, 3));
|
||||
super("unset", "Unsets a permission for a group", "<node> [server] [world]", Permission.GROUP_UNSETPERMISSION,
|
||||
Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,7 +47,7 @@ public class GroupUnSetPermission extends SubCommand<Group> {
|
||||
String node = args.get(0).replace("{SPACE}", " ");
|
||||
|
||||
if (ArgumentChecker.checkNode(node)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,7 @@ import java.util.List;
|
||||
public class GroupUnsetInherit extends SubCommand<Group> {
|
||||
public GroupUnsetInherit() {
|
||||
super("unsetinherit", "Unsets another group for this group to inherit permissions from",
|
||||
"/%s group <group> unsetinherit <group> [server] [world]", Permission.GROUP_UNSETINHERIT,
|
||||
Predicate.notInRange(1, 3));
|
||||
"<group> [server] [world]", Permission.GROUP_UNSETINHERIT, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,7 +47,7 @@ public class GroupUnsetInherit extends SubCommand<Group> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,7 @@ import java.util.List;
|
||||
public class GroupUnsetTempInherit extends SubCommand<Group> {
|
||||
public GroupUnsetTempInherit() {
|
||||
super("unsettempinherit", "Unsets another group for this group to inherit permissions from",
|
||||
"/%s group <group> unsettempinherit <group> [server] [world]", Permission.GROUP_UNSET_TEMP_INHERIT,
|
||||
Predicate.notInRange(1, 3));
|
||||
"<group> [server] [world]", Permission.GROUP_UNSET_TEMP_INHERIT, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,7 +47,7 @@ public class GroupUnsetTempInherit extends SubCommand<Group> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -38,9 +38,8 @@ import java.util.List;
|
||||
|
||||
public class GroupUnsetTempPermission extends SubCommand<Group> {
|
||||
public GroupUnsetTempPermission() {
|
||||
super("unsettemp", "Unsets a temporary permission for a group",
|
||||
"/%s group <group> unsettemp <node> [server] [world]", Permission.GROUP_UNSET_TEMP_PERMISSION,
|
||||
Predicate.notInRange(1, 3));
|
||||
super("unsettemp", "Unsets a temporary permission for a group", "<node> [server] [world]",
|
||||
Permission.GROUP_UNSET_TEMP_PERMISSION, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,7 +47,7 @@ public class GroupUnsetTempPermission extends SubCommand<Group> {
|
||||
String node = args.get(0).replace("{SPACE}", " ");
|
||||
|
||||
if (ArgumentChecker.checkNode(node)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ import java.util.List;
|
||||
|
||||
public class LogExport extends SubCommand<Log> {
|
||||
public LogExport() {
|
||||
super("export", "Export the log to a file", "/%s log export <file>", Permission.LOG_EXPORT, Predicate.not(1));
|
||||
super("export", "Export the log to a file", "<file>", Permission.LOG_EXPORT, Predicate.not(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,7 +40,7 @@ import java.util.SortedMap;
|
||||
|
||||
public class LogGroupHistory extends SubCommand<Log> {
|
||||
public LogGroupHistory() {
|
||||
super("grouphistory", "View an objects history", "/%s log grouphistory <group> [page]", Permission.LOG_GROUP_HISTORY,
|
||||
super("grouphistory", "View an objects history", "<group> [page]", Permission.LOG_GROUP_HISTORY,
|
||||
Predicate.notInRange(1, 2));
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,7 @@ import java.util.UUID;
|
||||
|
||||
public class LogNotify extends SubCommand<Log> {
|
||||
public LogNotify() {
|
||||
super("notify", "Toggle notifications", "/%s log notify [on|off]", Permission.LOG_NOTIFY,
|
||||
Predicate.notInRange(0, 1));
|
||||
super("notify", "Toggle notifications", "[on|off]", Permission.LOG_NOTIFY, Predicate.notInRange(0, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,8 +38,7 @@ import java.util.UUID;
|
||||
|
||||
public class LogRecent extends SubCommand<Log> {
|
||||
public LogRecent() {
|
||||
super("recent", "View recent actions", "/%s log recent [user] [page]", Permission.LOG_RECENT,
|
||||
Predicate.notInRange(0, 2));
|
||||
super("recent", "View recent actions", "[user] [page]", Permission.LOG_RECENT, Predicate.notInRange(0, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,8 +40,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class LogSearch extends SubCommand<Log> {
|
||||
public LogSearch() {
|
||||
super("search", "Search the log for an entry", "/%s log search <query> [page]", Permission.LOG_SEARCH,
|
||||
Predicate.is(0));
|
||||
super("search", "Search the log for an entry", "<query> [page]", Permission.LOG_SEARCH, Predicate.is(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,8 +40,7 @@ import java.util.SortedMap;
|
||||
|
||||
public class LogTrackHistory extends SubCommand<Log> {
|
||||
public LogTrackHistory() {
|
||||
super("trackhistory", "View an objects history", "/%s log trackhistory <track> [page]", Permission.LOG_TRACK_HISTORY,
|
||||
Predicate.notInRange(1, 2));
|
||||
super("trackhistory", "View an objects history", "<track> [page]", Permission.LOG_TRACK_HISTORY, Predicate.notInRange(1, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,8 +38,7 @@ import java.util.UUID;
|
||||
|
||||
public class LogUserHistory extends SubCommand<Log> {
|
||||
public LogUserHistory() {
|
||||
super("userhistory", "View an objects history", "/%s log userhistory <user> [page]", Permission.LOG_USER_HISTORY,
|
||||
Predicate.notInRange(1, 2));
|
||||
super("userhistory", "View an objects history", "<user> [page]", Permission.LOG_USER_HISTORY, Predicate.notInRange(1, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,7 +82,7 @@ public class MigrationBPermissions extends SubCommand<Object> {
|
||||
}
|
||||
|
||||
public MigrationBPermissions() {
|
||||
super("bpermissions", "Migration from bPermissions", "/%s migration bpermissions", MIGRATION, Predicate.alwaysFalse());
|
||||
super("bpermissions", "Migration from bPermissions", "", MIGRATION, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,8 +43,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class MigrationBungeePerms extends SubCommand<Object> {
|
||||
public MigrationBungeePerms() {
|
||||
super("bungeeperms", "Migration from BungeePerms", "/%s migration bungeeperms",
|
||||
Permission.MIGRATION, Predicate.alwaysFalse());
|
||||
super("bungeeperms", "Migration from BungeePerms", "", Permission.MIGRATION, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,8 +45,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class MigrationGroupManager extends SubCommand<Object> {
|
||||
public MigrationGroupManager() {
|
||||
super("groupmanager", "Migration from GroupManager", "/%s migration groupmanager [world names]",
|
||||
Permission.MIGRATION, Predicate.is(0));
|
||||
super("groupmanager", "Migration from GroupManager", "[world names...]", Permission.MIGRATION, Predicate.is(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,8 +50,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class MigrationPermissionsEx extends SubCommand<Object> {
|
||||
public MigrationPermissionsEx() {
|
||||
super("permissionsex", "Migration from PermissionsEx", "/%s migration permissionsex [world names]",
|
||||
Permission.MIGRATION, Predicate.alwaysFalse());
|
||||
super("permissionsex", "Migration from PermissionsEx", "[world names...]", Permission.MIGRATION, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -119,8 +119,8 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
|
||||
|
||||
|
||||
public MigrationPowerfulPerms() {
|
||||
super("powerfulperms", "Migration from PowerfulPerms",
|
||||
"/%s migration powerfulperms <address> <database> <username> <password> <db table>", MIGRATION, Predicate.not(5));
|
||||
super("powerfulperms", "Migration from PowerfulPerms", "<address> <database> <username> <password> <db table>",
|
||||
MIGRATION, Predicate.not(5));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,8 +49,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public class MigrationZPermissions extends SubCommand<Object> {
|
||||
public MigrationZPermissions() {
|
||||
super("zpermissions", "Migration from zPermissions", "/%s migration zpermissions [world names]",
|
||||
Permission.MIGRATION, Predicate.alwaysFalse());
|
||||
super("zpermissions", "Migration from zPermissions", "[world names...]", Permission.MIGRATION, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,8 +36,7 @@ import java.util.List;
|
||||
|
||||
public class TrackAppend extends SubCommand<Track> {
|
||||
public TrackAppend() {
|
||||
super("append", "Appends a group onto the end of the track", "/%s track <track> append <group>",
|
||||
Permission.TRACK_APPEND, Predicate.not(1));
|
||||
super("append", "Appends a group onto the end of the track", "<group>", Permission.TRACK_APPEND, Predicate.not(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -45,7 +44,7 @@ public class TrackAppend extends SubCommand<Track> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,7 @@ import java.util.List;
|
||||
|
||||
public class TrackClear extends SubCommand<Track> {
|
||||
public TrackClear() {
|
||||
super("clear", "Clears the groups on the track", "/%s track <track> clear", Permission.TRACK_CLEAR,
|
||||
Predicate.alwaysFalse());
|
||||
super("clear", "Clears the groups on the track", "", Permission.TRACK_CLEAR, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,8 +32,7 @@ import java.util.List;
|
||||
|
||||
public class TrackInfo extends SubCommand<Track> {
|
||||
public TrackInfo() {
|
||||
super("info", "Gives info about the track", "/%s track <track> info", Permission.TRACK_INFO,
|
||||
Predicate.alwaysFalse());
|
||||
super("info", "Gives info about the track", "", Permission.TRACK_INFO, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,8 +36,8 @@ import java.util.List;
|
||||
|
||||
public class TrackInsert extends SubCommand<Track> {
|
||||
public TrackInsert() {
|
||||
super("insert", "Inserts a group at a given position along the track",
|
||||
"/%s track <track> insert <group> <position>", Permission.TRACK_INSERT, Predicate.not(2));
|
||||
super("insert", "Inserts a group at a given position along the track", "<group> <position>",
|
||||
Permission.TRACK_INSERT, Predicate.not(2));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -45,7 +45,7 @@ public class TrackInsert extends SubCommand<Track> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -35,8 +35,7 @@ import java.util.List;
|
||||
|
||||
public class TrackRemove extends SubCommand<Track> {
|
||||
public TrackRemove() {
|
||||
super("remove", "Removes a group from the track", "/%s track <track> remove <group>", Permission.TRACK_REMOVE,
|
||||
Predicate.not(1));
|
||||
super("remove", "Removes a group from the track", "<group>", Permission.TRACK_REMOVE, Predicate.not(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -44,7 +43,7 @@ public class TrackRemove extends SubCommand<Track> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,7 @@ import java.util.List;
|
||||
|
||||
public class TrackRename extends SubCommand<Track> {
|
||||
public TrackRename() {
|
||||
super("rename", "Rename this track", "/%s track <track> rename <new name>",
|
||||
Permission.TRACK_APPEND, Predicate.not(1));
|
||||
super("rename", "Rename this track", "<new name>", Permission.TRACK_APPEND, Predicate.not(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,8 +39,7 @@ import java.util.List;
|
||||
|
||||
public class UserAddGroup extends SubCommand<User> {
|
||||
public UserAddGroup() {
|
||||
super("addgroup", "Adds the user to a group", "/%s user <user> addgroup <group> [server] [world]",
|
||||
Permission.USER_ADDGROUP, Predicate.notInRange(1, 3));
|
||||
super("addgroup", "Adds the user to a group", "<group> [server] [world]", Permission.USER_ADDGROUP, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,7 +47,7 @@ public class UserAddGroup extends SubCommand<User> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,8 @@ import java.util.List;
|
||||
|
||||
public class UserAddPrefix extends SubCommand<User> {
|
||||
public UserAddPrefix() {
|
||||
super("addprefix", "Adds a prefix to the user", "/%s user <user> addprefix <priority> <prefix> [server] [world]",
|
||||
Permission.USER_ADDPREFIX, Predicate.notInRange(2, 4));
|
||||
super("addprefix", "Adds a prefix to the user", "<priority> <prefix> [server] [world]", Permission.USER_ADDPREFIX,
|
||||
Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,8 +38,8 @@ import java.util.List;
|
||||
|
||||
public class UserAddSuffix extends SubCommand<User> {
|
||||
public UserAddSuffix() {
|
||||
super("addsuffix", "Adds a suffix to the user", "/%s user <user> addsuffix <priority> <suffix> [server] [world]",
|
||||
Permission.USER_ADDSUFFIX, Predicate.notInRange(2, 4));
|
||||
super("addsuffix", "Adds a suffix to the user", "<priority> <suffix> [server] [world]", Permission.USER_ADDSUFFIX,
|
||||
Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,9 +40,8 @@ import java.util.List;
|
||||
|
||||
public class UserAddTempGroup extends SubCommand<User> {
|
||||
public UserAddTempGroup() {
|
||||
super("addtempgroup", "Adds the user to a group temporarily",
|
||||
"/%s user <user> addtempgroup <group> <duration> [server] [world]", Permission.USER_ADDTEMPGROUP,
|
||||
Predicate.notInRange(2, 4));
|
||||
super("addtempgroup", "Adds the user to a group temporarily", "<group> <duration> [server] [world]",
|
||||
Permission.USER_ADDTEMPGROUP, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -50,7 +49,7 @@ public class UserAddTempGroup extends SubCommand<User> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ import java.util.List;
|
||||
|
||||
public class UserAddTempPrefix extends SubCommand<User> {
|
||||
public UserAddTempPrefix() {
|
||||
super("addtempprefix", "Adds a prefix to the user temporarily", "/%s user <user> addtempprefix <priority> <prefix> <duration> [server] [world]",
|
||||
super("addtempprefix", "Adds a prefix to the user temporarily", "<priority> <prefix> <duration> [server] [world]",
|
||||
Permission.USER_ADD_TEMP_PREFIX, Predicate.notInRange(3, 5));
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ import java.util.List;
|
||||
|
||||
public class UserAddTempSuffix extends SubCommand<User> {
|
||||
public UserAddTempSuffix() {
|
||||
super("addtempsuffix", "Adds a suffix to the user temporarily", "/%s user <user> addtempsuffix <priority> <suffix> <duration> [server] [world]",
|
||||
super("addtempsuffix", "Adds a suffix to the user temporarily", "<priority> <suffix> <duration> [server] [world]",
|
||||
Permission.USER_ADD_TEMP_SUFFIX, Predicate.notInRange(3, 5));
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,7 @@ import java.util.TreeSet;
|
||||
|
||||
public class UserChatMeta extends SubCommand<User> {
|
||||
public UserChatMeta() {
|
||||
super("chatmeta", "Displays a users chat meta", "/%s user <user> chatmeta", Permission.USER_CHATMETA,
|
||||
Predicate.alwaysFalse());
|
||||
super("chatmeta", "Displays a users chat meta", "", Permission.USER_CHATMETA, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,8 +36,7 @@ import java.util.List;
|
||||
|
||||
public class UserClear extends SubCommand<User> {
|
||||
public UserClear() {
|
||||
super("clear", "Clears a users permissions and groups", "/%s user <user> clear", Permission.USER_CLEAR,
|
||||
Predicate.alwaysFalse());
|
||||
super("clear", "Clears a users permissions and groups", "", Permission.USER_CLEAR, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,8 +41,7 @@ import java.util.List;
|
||||
|
||||
public class UserDemote extends SubCommand<User> {
|
||||
public UserDemote() {
|
||||
super("demote", "Demotes a user along a track", "/%s user <user> demote <track>", Permission.USER_DEMOTE,
|
||||
Predicate.not(1));
|
||||
super("demote", "Demotes a user along a track", "<track>", Permission.USER_DEMOTE, Predicate.not(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,8 +35,7 @@ import java.util.List;
|
||||
|
||||
public class UserGetUUID extends SubCommand<User> {
|
||||
public UserGetUUID() {
|
||||
super("getuuid", "Get the UUID of a user", "/%s user <user> getuuid", Permission.USER_GETUUID,
|
||||
Predicate.alwaysFalse());
|
||||
super("getuuid", "Get the UUID of a user", "", Permission.USER_GETUUID, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,9 +33,8 @@ import java.util.List;
|
||||
|
||||
public class UserHasPerm extends SubCommand<User> {
|
||||
public UserHasPerm() {
|
||||
super("haspermission", "Checks to see if a user has a certain permission node",
|
||||
"/%s user <user> haspermission <node> [server] [world]", Permission.USER_HASPERMISSION,
|
||||
Predicate.notInRange(1, 3));
|
||||
super("haspermission", "Checks to see if a user has a certain permission node", "<node> [server] [world]",
|
||||
Permission.USER_HASPERMISSION, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +35,7 @@ import java.util.List;
|
||||
|
||||
public class UserInfo extends SubCommand<User> {
|
||||
public UserInfo() {
|
||||
super("info", "Gives info about the user", "/%s user <user> info", Permission.USER_INFO, Predicate.alwaysFalse());
|
||||
super("info", "Gives info about the user", "", Permission.USER_INFO, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,8 +34,7 @@ import java.util.List;
|
||||
public class UserInheritsPerm extends SubCommand<User> {
|
||||
public UserInheritsPerm() {
|
||||
super("inheritspermission", "Checks to see if a user inherits a certain permission node",
|
||||
"/%s user <user> inheritspermission <node> [server] [world]", Permission.USER_INHERITSPERMISSION,
|
||||
Predicate.notInRange(1, 3));
|
||||
"<node> [server] [world]", Permission.USER_INHERITSPERMISSION, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,8 +32,7 @@ import java.util.List;
|
||||
|
||||
public class UserListGroups extends SubCommand<User> {
|
||||
public UserListGroups() {
|
||||
super("listgroups", "Lists the groups a user is in", "/%s user <user> listgroups",
|
||||
Permission.USER_LISTGROUPS, Predicate.alwaysFalse());
|
||||
super("listgroups", "Lists the groups a user is in", "", Permission.USER_LISTGROUPS, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,8 +32,7 @@ import java.util.List;
|
||||
|
||||
public class UserListNodes extends SubCommand<User> {
|
||||
public UserListNodes() {
|
||||
super("listnodes", "Lists the permission nodes the user has", "/%s user <user> listnodes",
|
||||
Permission.USER_LISTNODES, Predicate.alwaysFalse());
|
||||
super("listnodes", "Lists the permission nodes the user has", "", Permission.USER_LISTNODES, Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,8 +41,7 @@ import java.util.List;
|
||||
|
||||
public class UserPromote extends SubCommand<User> {
|
||||
public UserPromote() {
|
||||
super("promote", "Promotes the user along a track", "/%s user <user> promote <track>", Permission.USER_PROMOTE,
|
||||
Predicate.not(1));
|
||||
super("promote", "Promotes the user along a track", "<track>", Permission.USER_PROMOTE, Predicate.not(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,8 +38,8 @@ import java.util.List;
|
||||
|
||||
public class UserRemoveGroup extends SubCommand<User> {
|
||||
public UserRemoveGroup() {
|
||||
super("removegroup", "Removes a user from a group", "/%s user <user> removegroup <group> [server] [world]",
|
||||
Permission.USER_REMOVEGROUP, Predicate.notInRange(1, 3));
|
||||
super("removegroup", "Removes a user from a group", "<group> [server] [world]", Permission.USER_REMOVEGROUP,
|
||||
Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,7 +47,7 @@ public class UserRemoveGroup extends SubCommand<User> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class UserRemovePrefix extends SubCommand<User> {
|
||||
public UserRemovePrefix() {
|
||||
super("removeprefix", "Removes a prefix from a user", "/%s user <user> removeprefix <priority> <prefix> [server] [world]",
|
||||
super("removeprefix", "Removes a prefix from a user", "<priority> <prefix> [server] [world]",
|
||||
Permission.USER_REMOVEPREFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class UserRemoveSuffix extends SubCommand<User> {
|
||||
public UserRemoveSuffix() {
|
||||
super("removesuffix", "Removes a suffix from a user", "/%s user <user> removesuffix <priority> <suffix> [server] [world]",
|
||||
super("removesuffix", "Removes a suffix from a user", "<priority> <suffix> [server] [world]",
|
||||
Permission.USER_REMOVESUFFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -38,9 +38,8 @@ import java.util.List;
|
||||
|
||||
public class UserRemoveTempGroup extends SubCommand<User> {
|
||||
public UserRemoveTempGroup() {
|
||||
super("removetempgroup", "Removes a user from a temporary group",
|
||||
"/%s user <user> removetempgroup <group> [server] [world]", Permission.USER_REMOVETEMPGROUP,
|
||||
Predicate.notInRange(1, 3));
|
||||
super("removetempgroup", "Removes a user from a temporary group", "<group> [server] [world]",
|
||||
Permission.USER_REMOVETEMPGROUP, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,7 +47,7 @@ public class UserRemoveTempGroup extends SubCommand<User> {
|
||||
String groupName = args.get(0).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(groupName)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class UserRemoveTempPrefix extends SubCommand<User> {
|
||||
public UserRemoveTempPrefix() {
|
||||
super("removetempprefix", "Removes a temporary prefix from a user", "/%s user <user> removetempprefix <priority> <prefix> [server] [world]",
|
||||
super("removetempprefix", "Removes a temporary prefix from a user", "<priority> <prefix> [server] [world]",
|
||||
Permission.USER_REMOVE_TEMP_PREFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||
|
||||
public class UserRemoveTempSuffix extends SubCommand<User> {
|
||||
public UserRemoveTempSuffix() {
|
||||
super("removetempsuffix", "Removes a temporary suffix from a user", "/%s user <user> removetempsuffix <priority> <suffix> [server] [world]",
|
||||
super("removetempsuffix", "Removes a temporary suffix from a user", "<priority> <suffix> [server] [world]",
|
||||
Permission.USER_REMOVE_TEMP_SUFFIX, Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,7 @@ import java.util.List;
|
||||
|
||||
public class UserSetPermission extends SubCommand<User> {
|
||||
public UserSetPermission() {
|
||||
super("set", "Sets a permission for a user",
|
||||
"/%s user <user> set <node> <true|false> [server] [world]", Permission.USER_SETPERMISSION,
|
||||
super("set", "Sets a permission for a user", "<node> <true|false> [server] [world]", Permission.USER_SETPERMISSION,
|
||||
Predicate.notInRange(2, 4));
|
||||
}
|
||||
|
||||
@ -49,7 +48,7 @@ public class UserSetPermission extends SubCommand<User> {
|
||||
String bool = args.get(1).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(node)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
@ -59,7 +58,7 @@ public class UserSetPermission extends SubCommand<User> {
|
||||
}
|
||||
|
||||
if (!bool.equalsIgnoreCase("true") && !bool.equalsIgnoreCase("false")) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,7 @@ import java.util.List;
|
||||
|
||||
public class UserSetPrimaryGroup extends SubCommand<User> {
|
||||
public UserSetPrimaryGroup() {
|
||||
super("setprimarygroup", "Sets a users primary group",
|
||||
"/%s user <user> setprimarygroup <group>", Permission.USER_SETPRIMARYGROUP, Predicate.not(1));
|
||||
super("setprimarygroup", "Sets a users primary group", "<group>", Permission.USER_SETPRIMARYGROUP, Predicate.not(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,8 +39,7 @@ import java.util.List;
|
||||
|
||||
public class UserSetTempPermission extends SubCommand<User> {
|
||||
public UserSetTempPermission() {
|
||||
super("settemp", "Sets a temporary permission for a user",
|
||||
"/%s user <user> settemp <node> <true|false> <duration> [server] [world]",
|
||||
super("settemp", "Sets a temporary permission for a user", "<node> <true|false> <duration> [server] [world]",
|
||||
Permission.USER_SET_TEMP_PERMISSION, Predicate.notInRange(3, 5));
|
||||
}
|
||||
|
||||
@ -50,7 +49,7 @@ public class UserSetTempPermission extends SubCommand<User> {
|
||||
String bool = args.get(1).toLowerCase();
|
||||
|
||||
if (ArgumentChecker.checkNode(node)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
@ -60,7 +59,7 @@ public class UserSetTempPermission extends SubCommand<User> {
|
||||
}
|
||||
|
||||
if (!bool.equalsIgnoreCase("true") && !bool.equalsIgnoreCase("false")) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,7 @@ import java.util.List;
|
||||
|
||||
public class UserShowPos extends SubCommand<User> {
|
||||
public UserShowPos() {
|
||||
super("showpos", "Shows a users position on a track", "/%s user <user> showpos <track>", Permission.USER_SHOWPOS,
|
||||
Predicate.not(1));
|
||||
super("showpos", "Shows a users position on a track", "<track>", Permission.USER_SHOWPOS, Predicate.not(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,8 +34,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class UserShowTracks extends SubCommand<User> {
|
||||
public UserShowTracks() {
|
||||
super("showtracks", "Lists the tracks that this user's primary group features on", "/%s user <user> showtracks",
|
||||
Permission.USER_SHOWTRACKS, Predicate.alwaysFalse());
|
||||
super("showtracks", "Lists the tracks that this user's primary group features on", "", Permission.USER_SHOWTRACKS,
|
||||
Predicate.alwaysFalse());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,8 +38,8 @@ import java.util.List;
|
||||
|
||||
public class UserUnSetPermission extends SubCommand<User> {
|
||||
public UserUnSetPermission() {
|
||||
super("unset", "Unsets a permission for a user",
|
||||
"/%s user <user> unset <node> [server] [world]", Permission.USER_UNSETPERMISSION, Predicate.notInRange(1, 3));
|
||||
super("unset", "Unsets a permission for a user", "<node> [server] [world]", Permission.USER_UNSETPERMISSION,
|
||||
Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,7 +47,7 @@ public class UserUnSetPermission extends SubCommand<User> {
|
||||
String node = args.get(0).replace("{SPACE}", " ");
|
||||
|
||||
if (ArgumentChecker.checkNode(node)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
@ -38,9 +38,8 @@ import java.util.List;
|
||||
|
||||
public class UserUnsetTempPermission extends SubCommand<User> {
|
||||
public UserUnsetTempPermission() {
|
||||
super("unsettemp", "Unsets a temporary permission for a user",
|
||||
"/%s user <user> unsettemp <node> [server] [world]", Permission.USER_UNSET_TEMP_PERMISSION,
|
||||
Predicate.notInRange(1, 3));
|
||||
super("unsettemp", "Unsets a temporary permission for a user", "<node> [server] [world]",
|
||||
Permission.USER_UNSET_TEMP_PERMISSION, Predicate.notInRange(1, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,7 +47,7 @@ public class UserUnsetTempPermission extends SubCommand<User> {
|
||||
String node = args.get(0).replace("{SPACE}", " ");
|
||||
|
||||
if (ArgumentChecker.checkNode(node)) {
|
||||
sendUsage(sender, label);
|
||||
sendUsage(sender);
|
||||
return CommandResult.INVALID_ARGS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user