This commit is contained in:
kento2 2026-06-03 00:42:59 +02:00
parent 3cb30b1489
commit b091eb3377
9 changed files with 16 additions and 51 deletions

View file

@ -1,13 +1,13 @@
package de.kentoj.kencommandapi.api.nodes;
import de.kentoj.kencommandapi.api.processing.CommandContext;
import de.kentoj.kencommandapi.api.argument.CommandArgument;
import de.kentoj.kencommandapi.api.processing.CommandContext;
import java.util.Set;
import java.util.List;
public interface ArgumentNode<T, S extends CommandContext<T, ?>> {
<V> void addArgument(CommandArgument<T, S, V> argument);
Set<CommandArgument<T, S, ?>> getArguments();
List<CommandArgument<T, S, ?>> getArguments();
}

View file

@ -1,12 +1,16 @@
package de.kentoj.kencommandapi.api.types;
import de.kentoj.kencommandapi.api.processing.CommandContext;
import de.kentoj.kencommandapi.api.argument.ArgumentType;
import de.kentoj.kencommandapi.api.argument.SuggestionProvider;
import de.kentoj.kencommandapi.api.argument.suggestion.NoSuggestionProvider;
import de.kentoj.kencommandapi.api.processing.CommandContext;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class StringArgumentType<T, S extends CommandContext<T, ?>> implements ArgumentType<T, S, String> {
private final boolean isGreedy;
@Override
public String parseInput(String string) {
return string;
@ -16,4 +20,9 @@ public class StringArgumentType<T, S extends CommandContext<T, ?>> implements Ar
public SuggestionProvider<T, S> defaultSuggestionProvider() {
return new NoSuggestionProvider<>();
}
@Override
public boolean isGreedy() {
return this.isGreedy;
}
}