mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 04:26:42 +00:00
Don't use a no-op suggester
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
package com.sk89q.worldedit.internal.registry;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.enginehub.piston.converter.SuggestionHelper.limitByPrefix;
|
||||
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
@ -79,8 +80,8 @@ public abstract class AbstractFactory<E> {
|
||||
throw new NoMatchException("No match for '" + input + "'");
|
||||
}
|
||||
|
||||
public Stream<String> getSuggestions() {
|
||||
return parsers.stream().flatMap(InputParser::getSuggestions);
|
||||
public List<String> getSuggestions(String input) {
|
||||
return limitByPrefix(parsers.stream().flatMap(parser -> parser.getSuggestions(input)), input);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ public abstract class InputParser<E> {
|
||||
*
|
||||
* @return a stream of suggestions
|
||||
*/
|
||||
public Stream<String> getSuggestions() {
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
return Stream.empty();
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public abstract class SimpleInputParser<E> extends InputParser<E> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions() {
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
return Stream.of(getPrimaryMatcher());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user