2018-12-24 22:16:38 +00:00
|
|
|
package net.shadowfacts.simplemultipart.util;
|
|
|
|
|
|
|
|
import net.minecraft.util.BooleanBiFunction;
|
|
|
|
import net.minecraft.util.shape.VoxelShape;
|
|
|
|
import net.minecraft.util.shape.VoxelShapes;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author shadowfacts
|
|
|
|
*/
|
|
|
|
public class ShapeUtils {
|
|
|
|
|
|
|
|
public static boolean intersect(VoxelShape a, VoxelShape b) {
|
2018-12-25 15:20:44 +00:00
|
|
|
// TODO: this seems very inefficient
|
2018-12-24 22:16:38 +00:00
|
|
|
VoxelShape overlap = VoxelShapes.combine(a, b, BooleanBiFunction.AND);
|
|
|
|
return !overlap.isEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|