From d7fcef6c3d398c37878758ef273414285cb19076 Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Thu, 7 May 2015 21:05:08 +0200 Subject: [PATCH] Fix bug in useageTemplate and a bug with required args from console. --- src/com/massivecraft/massivecore/cmd/ArgSetting.java | 2 +- src/com/massivecraft/massivecore/cmd/MassiveCommand.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/massivecore/cmd/ArgSetting.java b/src/com/massivecraft/massivecore/cmd/ArgSetting.java index 9d333d0d..519ba38a 100644 --- a/src/com/massivecraft/massivecore/cmd/ArgSetting.java +++ b/src/com/massivecraft/massivecore/cmd/ArgSetting.java @@ -30,7 +30,7 @@ public class ArgSetting // Is this arg ALWAYS required from the console? // That might the case if the arg is a player. and default is oneself. protected boolean requiredFromConsole = false; - public boolean isRequiredFromConsole() { return requiredFromConsole && this.isRequired(); } + public boolean isRequiredFromConsole() { return requiredFromConsole; } public ArgSetting setRequiredFromConsole(boolean requiredFromConsole) { this.requiredFromConsole = requiredFromConsole; return this; } // An optional description of this argument. diff --git a/src/com/massivecraft/massivecore/cmd/MassiveCommand.java b/src/com/massivecraft/massivecore/cmd/MassiveCommand.java index 599a61e9..71b7a295 100644 --- a/src/com/massivecraft/massivecore/cmd/MassiveCommand.java +++ b/src/com/massivecraft/massivecore/cmd/MassiveCommand.java @@ -633,7 +633,7 @@ public class MassiveCommand } // Ensure that the required args are filled. - for (int i = 0; i < this.getRequiredArgsAmountFor(sender);i++) + for (int i = 0; i < this.getRequiredArgsAmountFor(sender); i++) { if (ret[i] != null) continue; // We end up here if an required arg wasn't filled. In that case we failed. @@ -892,7 +892,7 @@ public class MassiveCommand public String getUseageTemplate(List commandChain, boolean addDesc, boolean onlyFirstAlias) { - return getUseageTemplate(commandChain, addDesc, onlyFirstAlias, null); + return getUseageTemplate(commandChain, addDesc, onlyFirstAlias, sender); } public String getUseageTemplate(List commandChain, boolean addDesc)