diff --git a/src/com/massivecraft/massivecore/command/editor/EditSettings.java b/src/com/massivecraft/massivecore/command/editor/EditSettings.java index 7524de6e..52b3d90a 100644 --- a/src/com/massivecraft/massivecore/command/editor/EditSettings.java +++ b/src/com/massivecraft/massivecore/command/editor/EditSettings.java @@ -99,16 +99,24 @@ public class EditSettings // No nice constructors for TreeSet :( public static final Set ALIASES_USED = MUtil.treeset("used", "selected", "chosen"); - public O getUsedOrCommandException(CommandSender sender, String arg) throws MassiveException + public O getUsedOrCommandException(String arg, CommandSender sender) throws MassiveException { - if (arg == null || ALIASES_USED.contains(arg)) + if (arg == null) { O ret = this.getUsed(sender); if (ret != null) return ret; + String noun = this.getObjectType().getTypeName(); + String aan = Txt.aan(noun); + throw new MassiveException().addMsg("You must select %s %s for use to skip the optional argument.", aan, noun); } - String noun = this.getObjectType().getTypeName(); - String aan = Txt.aan(noun); - throw new MassiveException().addMsg("You must select %s %s for use to skip the optional argument.", aan, noun); + if (ALIASES_USED.contains(arg)) + { + O ret = this.getUsed(sender); + if (ret == null) throw new MassiveException().addMsg("You have no selected %s.", this.getObjectType().getTypeName() ); + return ret; + } + + return null; } }