Void roots fixes

This commit is contained in:
paulevsGitch 2020-11-10 12:14:44 +03:00
parent 2f31dad5a2
commit d3faca6016
5 changed files with 4 additions and 22 deletions

View file

@ -13,7 +13,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockPos.Mutable;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.StructureWorldAccess;
import ru.betterend.registry.EndTags;
import ru.betterend.util.sdf.SDF;
import ru.betterend.util.sdf.operator.SDFUnion;
import ru.betterend.util.sdf.primitive.SDFLine;
@ -88,22 +87,6 @@ public class SplineHelper {
return true;
}
public static boolean fillSplineRoot(List<Vector3f> spline, StructureWorldAccess world, BlockState state, BlockPos pos, Function<BlockState, Boolean> replace) {
Vector3f startPos = spline.get(0);
for (int i = 1; i < spline.size(); i++) {
Vector3f endPos = spline.get(i);
if (i > 3 && !world.getBlockState(pos.add(endPos.getX(), endPos.getY(), endPos.getZ())).isIn(EndTags.END_GROUND)) {
return false;
}
if (!(fillLine(startPos, endPos, world, state, pos, replace))) {
return false;
}
startPos = endPos;
}
return true;
}
private static boolean fillLine(Vector3f start, Vector3f end, StructureWorldAccess world, BlockState state, BlockPos pos, Function<BlockState, Boolean> replace) {
float dx = end.getX() - start.getX();
float dy = end.getY() - start.getY();