Permalink
Browse files

Not all "north/south/east/west" are boolean

  • Loading branch information...
me4502 committed Oct 11, 2018
1 parent d1cb6e2 commit 495b9d07b5f2d81ef7fe93d603f9d588540c7ee8
@@ -24,6 +24,7 @@
import com.google.common.collect.Sets;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.registry.state.BooleanProperty;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent;
@@ -140,8 +141,10 @@ public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEdi
}
List<String> directionalProperties = properties.stream()
.filter(prop -> prop instanceof BooleanProperty)
.filter(prop -> directionNames.contains(prop.getName()))
.filter(prop -> ((Boolean) block.getState(prop)))
.map(prop -> (BooleanProperty) prop)
.filter(block::getState)
.map(Property::getName)
.map(String::toUpperCase)
.map(Direction::valueOf)

0 comments on commit 495b9d0

Please sign in to comment.