Ignore invalid blocks

This commit is contained in:
Jesse Boyd 2019-11-12 07:32:05 +00:00
parent 59b8776814
commit 322e186c4b
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -8,6 +8,7 @@ import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockType;
import java.util.Arrays;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
@ -22,7 +23,7 @@ public class BlockStateListFlag extends ListFlag<Set<BlockType>> {
}
@Override public Set<BlockType> parseValue(final String value) {
return Arrays.stream(BlockUtil.parse(value)).map(BlockState::getBlockType).collect(Collectors.toSet());
return Arrays.stream(BlockUtil.parse(value)).filter(Objects::nonNull).map(BlockState::getBlockType).collect(Collectors.toSet());
}
@Override public String getValueDescription() {