public void forEachBlockPosMutableTopDown(Predicate<BlockPos> func){
  BlockPos.MutableBlockPos blockPos=new BlockPos.MutableBlockPos();
  int baseX=getMinBlockX();
  int baseZ=getMinBlockZ();
  int blockYMax=getMaxBlockY();
  for (int x=0; x < 16; x++) {
    for (int z=0; z < 16; z++) {
      blockPos.setPos(baseX + x,blockYMax,baseZ + z);
      for (int y=15; y >= 0; y--) {
        boolean cont=func.test(blockPos);
        blockPos.move(EnumFacing.DOWN);
        if (!cont) {
          break;
        }
      }
    }
  }
}

public void forEachBlockPosMutableTopDown ( Predicate < BlockPos > func ) { BlockPos . MutableBlockPos blockPos = new BlockPos . MutableBlockPos ( ) ; int baseX = getMinBlockX ( ) ; int baseZ = getMinBlockZ ( ) ; int blockYMax = getMaxBlockY ( ) ; for ( int x = 0 ; x < 16 ; x ++ ) { for ( int z = 0 ; z < 16 ; z ++ ) { blockPos . setPos ( baseX + x , blockYMax , baseZ + z ) ; for ( int y = 15 ; y >= 0 ; y -- ) { boolean cont = func . test ( blockPos ) ; blockPos . move ( EnumFacing . DOWN ) ; if ( ! cont ) { break ; } } } } }
for each x / z coordinate pair in this cube position - goes top - down and calls func for each blockpos . once func returns false - processing of next block column begins .
