Added suggestions to a lot of factory-related commands

This commit is contained in:
Matthew Miller
2019-05-18 16:47:08 +10:00
parent 7b47d9a945
commit a3ffb91917
14 changed files with 75 additions and 17 deletions

View File

@ -52,6 +52,7 @@ import com.sk89q.worldedit.world.registry.LegacyMapper;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Stream;
/**
* Parses block input strings.
@ -199,6 +200,12 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
return blockStates;
}
@Override
public Stream<String> getSuggestions() {
// TODO Include states
return BlockType.REGISTRY.keySet().stream();
}
private BaseBlock parseLogic(String input, ParserContext context) throws InputParseException {
BlockType blockType = null;
Map<Property<?>, Object> blockStates = new HashMap<>();