From 86347c5a1b14f39325f2aa847cb2e00940d04f9e Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Wed, 13 May 2015 23:07:32 +0200 Subject: [PATCH] Fix obob --- src/com/massivecraft/massivecore/cmd/MassiveCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/massivecore/cmd/MassiveCommand.java b/src/com/massivecraft/massivecore/cmd/MassiveCommand.java index 4b5e9163..a5a7ada9 100644 --- a/src/com/massivecraft/massivecore/cmd/MassiveCommand.java +++ b/src/com/massivecraft/massivecore/cmd/MassiveCommand.java @@ -1144,6 +1144,9 @@ public class MassiveCommand // Make sure that an ArgSetting is present. if ( ! this.hasArgSettingForIndex(idx)) throw new IllegalArgumentException(idx + " is out of range. ArgSettings size: " + this.getArgSettings().size()); + // Read the arg here. To ensure counter is incremented. + String arg = this.argAt(idx); + // Get the setting ArgSetting setting = (ArgSetting) this.getArgSetting(idx); // Return the default in the setting. @@ -1153,7 +1156,6 @@ public class MassiveCommand if ( ! this.argIsSet(idx)) throw new IllegalArgumentException("Trying to access arg: " + idx + " but that is not set."); // Just read the arg normally. - String arg = this.argAt(idx); return setting.getReader().read(arg, sender); }