Vector3i checkBlockPos = tmps.tmp3i;
HexGeometry.cartesianToBlock(c.getX(), c.getY(), c.getZ(), tmps.tmp2d, checkBlockPos);
BlockTools.pointFloodSearch(checkBlockPos, new PointFloodSearchMatcher(){
@Override
public boolean matches(Vector3i p) {
Vector3d partialFix = Resources.vector3dResourcePool.aquire();
partialFix.x = 0;
partialFix.y = 0;
partialFix.z = 0;
collides(c, offset, p.x, p.y, p.z, partialFix, tmps.collidesTmps);
if (partialFix.x != 0 || partialFix.y != 0 || partialFix.z != 0){
Block b = chunks.getBlock(p.x, p.y, p.z, tmps.tmp3i, (Chunk)null);
if (checkCollidableBlock.isColliding(b)){
tmps.toFixBlockSet.add(partialFix);
return true;
}
else {
Resources.vector3dResourcePool.recycle(partialFix);
return true;
}
}
else {
Resources.vector3dResourcePool.recycle(partialFix);
}
return false;
}
});
Vector3d toFix = new Vector3d();
for (Vector3d toFixBlock : tmps.toFixBlockSet) {
toFix.add(toFixBlock);
Resources.vector3dResourcePool.recycle(toFixBlock);
}
if (toFix.mag() == 0)
return null;
else {
return toFix;
}
}