Skip to content

Instantly share code, notes, and snippets.

@StillManic
Last active April 10, 2016 02:41
Show Gist options
  • Save StillManic/a801176902a40c233576ed15d4adc30e to your computer and use it in GitHub Desktop.
Save StillManic/a801176902a40c233576ed15d4adc30e to your computer and use it in GitHub Desktop.
public boolean canBuildStructure(World world, StructureBoundingBox box, EnumFacing facing) {
BlockPos min = new BlockPos(box.minX, box.minY, box.minZ);
BlockPos max = new BlockPos(box.maxX, box.maxY, box.maxZ);
return Lists.newArrayList(BlockPos.getAllInBox(min, max)).stream().allMatch(pos -> world.getBlockState(pos).getBlock().isReplaceable(world, pos));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment