Fix tab completion for some elements.
I have no idea why I did this. I'm now undoing this.
@@ -220,7 +220,6 @@ public class NicknameArgument<T extends User> extends CommandElement {
@Override
public List<?> accept(String s, CommandSource cs, CommandArgs a) throws ArgumentParseException {
- try {
UserStorageService uss = Sponge.getServiceManager().provideUnchecked(UserStorageService.class);
if (this.onlyOne) {
return Lists.newArrayList(uss.get(s)
@@ -250,32 +249,8 @@ public class NicknameArgument<T extends User> extends CommandElement {
}
// If users is empty, then we should check online players.
-
- } catch (ArgumentParseException e) {
- // We want to rethrow this!
- throw e;
- }
-
return Lists.newArrayList();
}
}
- @Override public void parse(CommandSource source, CommandArgs args, CommandContext context) throws ArgumentParseException {
- if (context.hasAny(CommandContext.TAB_COMPLETION)) {
- // Are we at the end (so, is there this arg, and then the next?
- Object state = args.getState();
- try {
- // Should be there.
- args.next();
-
- // Should fail here if this is the last element.
- // We don't want to catch the error, because this will trigger the completion!
- args.next();
- } finally {
- args.setState(state);
- }
- }
-
- super.parse(source, args, context);
- }
}
