Show help on qa subcommand lacking args

This commit is contained in:
PikaMug 2022-05-15 08:52:41 -04:00
parent ae70523ac6
commit 67b8018f93
12 changed files with 48 additions and 0 deletions

View File

@ -69,6 +69,10 @@ public class QuestadminFinishCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_FINISH_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.finish")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.finish")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -68,6 +68,10 @@ public class QuestadminGiveCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_GIVE_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.give")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.give")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -66,6 +66,10 @@ public class QuestadminGivepointsCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_GIVEPOINTS_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.givepoints")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.givepoints")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -69,6 +69,10 @@ public class QuestadminNextstageCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_NEXTSTAGE_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.nextstage")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.nextstage")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -66,6 +66,10 @@ public class QuestadminPointsCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_POINTS_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.points")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.points")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -66,6 +66,10 @@ public class QuestadminPointsallCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_POINTSALL_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.pointsall")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.pointsall")) {
final int amount; final int amount;
try { try {

View File

@ -69,6 +69,10 @@ public class QuestadminQuitCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_QUIT_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.quit")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.quit")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -69,6 +69,10 @@ public class QuestadminRemoveCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_REMOVE_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") && cs.hasPermission("quests.admin.remove")) { if (cs.hasPermission("quests.admin.*") && cs.hasPermission("quests.admin.remove")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -68,6 +68,10 @@ public class QuestadminResetCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_RESET_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reset")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reset")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -70,6 +70,10 @@ public class QuestadminSetstageCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_SETSTAGE_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.setstage")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.setstage")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -67,6 +67,10 @@ public class QuestadminStatsCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_STATS_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") && cs.hasPermission("quests.admin.stats")) { if (cs.hasPermission("quests.admin.*") && cs.hasPermission("quests.admin.stats")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {

View File

@ -66,6 +66,10 @@ public class QuestadminTakepointsCommand extends QuestsSubCommand {
@Override @Override
public void execute(CommandSender cs, String[] args) { public void execute(CommandSender cs, String[] args) {
if (args.length == 1) {
cs.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_TAKEPOINTS_HELP"));
return;
}
if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.takepoints")) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.takepoints")) {
OfflinePlayer target = getOfflinePlayer(args[1]); OfflinePlayer target = getOfflinePlayer(args[1]);
if (target == null) { if (target == null) {