Skip to content

Commit

Permalink
Merge pull request #221 from ben9964/main
Browse files Browse the repository at this point in the history
Fix ScanObject Array Parser
  • Loading branch information
FrankHeijden authored Sep 11, 2024
2 parents 269aa5d + da80fcd commit be48394
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ public ScanObjectArrayParser(ParserParameters options) {
@Override
public ArgumentParseResult<ScanObject<?>[]> parse(CommandContext<C> ctx, CommandInput input) {
try {
int queueSize = input.length();
// Find the index of the first item in the *actual* input
// input.input() is the entire command
int indexOf = input.input().indexOf(input.peekString());

// Find the number of elements that need to be in the array
int queueSize = input.input().substring(indexOf).split(" ").length;

List<ScanObject<?>> items = new ArrayList<>(queueSize);
for (var i = 0; i < (queueSize - 1); i++) {
items.add(ScanObject.parse(input.peekString()));
Expand Down

0 comments on commit be48394

Please sign in to comment.