IConduitBundle bundle = (IConduitBundle) te;
List<RaytraceResult> hits = new ArrayList<RaytraceResult>();
if(ConduitUtil.isSolidFacadeRendered(bundle, player)) {
setBlockBounds(0, 0, 0, 1, 1, 1);
MovingObjectPosition hitPos = super.collisionRayTrace(world, x, y, z,
origin, direction);
if(hitPos != null) {
hits.add(new RaytraceResult(new CollidableComponent(null,
BoundingBox.UNIT_CUBE, ForgeDirection.UNKNOWN, null), hitPos));
}
} else {
Collection<CollidableComponent> components =
new ArrayList<CollidableComponent>(bundle.getCollidableComponents());
for (CollidableComponent component : components) {
setBlockBounds(component.bound.minX, component.bound.minY,
component.bound.minZ, component.bound.maxX, component.bound.maxY,
component.bound.maxZ);
MovingObjectPosition hitPos = super.collisionRayTrace(world, x, y, z,
origin, direction);
if(hitPos != null) {
hits.add(new RaytraceResult(component, hitPos));
}
}
// safety to prevent unbreakable empty bundles in case of a bug
if(bundle.getConduits().isEmpty() && !ConduitUtil.isFacadeHidden(bundle,
player)) {
setBlockBounds(0, 0, 0, 1, 1, 1);
MovingObjectPosition hitPos = super.collisionRayTrace(world, x, y, z,
origin, direction);
if(hitPos != null) {
hits.add(new RaytraceResult(null, hitPos));
}
}