mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Ignore invalid blocks
This commit is contained in:
parent
59b8776814
commit
322e186c4b
@ -8,6 +8,7 @@ import com.sk89q.worldedit.world.block.BlockState;
|
|||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ public class BlockStateListFlag extends ListFlag<Set<BlockType>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public Set<BlockType> parseValue(final String value) {
|
@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() {
|
@Override public String getValueDescription() {
|
||||||
|
Loading…
Reference in New Issue
Block a user