I don't like the duplicate in the VoxelData creation, its errorprone.
Please create the voxeldata before the if