Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 02:50:06 +01:00
Don't use a no-op suggester
Dieser Commit ist enthalten in:
Ursprung
a3ffb91917
Commit
4804fe64e3
@ -97,7 +97,7 @@ public class FactoryConverter<T> implements ArgumentConverter<T> {
|
||||
|
||||
@Override
|
||||
public List<String> getSuggestions(String input) {
|
||||
return limitByPrefix(factoryExtractor.apply(worldEdit).getSuggestions(), input);
|
||||
return factoryExtractor.apply(worldEdit).getSuggestions(input);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -201,7 +201,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions() {
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
// TODO Include states
|
||||
return BlockType.REGISTRY.keySet().stream();
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class DefaultItemParser extends InputParser<BaseItem> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions() {
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
return ItemType.REGISTRY.keySet().stream();
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class BiomeMaskParser extends InputParser<Mask> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions() {
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
return BiomeType.REGISTRY.keySet().stream().map(biomeType -> "$" + biomeType);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class BlockCategoryMaskParser extends InputParser<Mask> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions() {
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
return BlockCategory.REGISTRY.keySet().stream().map(str -> "##" + str);
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,8 @@ public class BlocksMaskParser extends InputParser<Mask> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions() {
|
||||
return worldEdit.getBlockFactory().getSuggestions();
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
return worldEdit.getBlockFactory().getSuggestions(input).stream();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,7 +40,7 @@ public class BlockCategoryPatternParser extends InputParser<Pattern> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions() {
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
return BlockCategory.REGISTRY.keySet().stream().map(str -> "##" + str);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class ClipboardPatternParser extends InputParser<Pattern> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions() {
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
return Stream.of("#clipboard", "#copy");
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,8 @@ public class SingleBlockPatternParser extends InputParser<Pattern> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<String> getSuggestions() {
|
||||
return worldEdit.getBlockFactory().getSuggestions();
|
||||
public Stream<String> getSuggestions(String input) {
|
||||
return worldEdit.getBlockFactory().getSuggestions(input).stream();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren