bb = bb.expandBy(cBB.bound);
}
}
if(bb != null) {
bb = bb.scale(1.05, 1.05, 1.05);
CollidableComponent cc = new CollidableComponent(null, bb, ForgeDirection.UNKNOWN,
ConduitConnectorType.INTERNAL);
result.add(cc);
cachedConnectors.add(cc);
}
}
//2nd algorithm
for (IConduit con : conduits) {
if(con.hasConnections()) {
List<CollidableComponent> cores = new ArrayList<CollidableComponent>();
addConduitCores(cores, con);
if(cores.size() > 1) {
BoundingBox bb = cores.get(0).bound;
float area = bb.getArea();
for (CollidableComponent cc : cores) {
bb = bb.expandBy(cc.bound);
}
if(bb.getArea() > area * 1.5f) {
bb = bb.scale(1.05, 1.05, 1.05);
CollidableComponent cc = new CollidableComponent(null, bb, ForgeDirection.UNKNOWN,
ConduitConnectorType.INTERNAL);
result.add(cc);
cachedConnectors.add(cc);
}
}
}
}
// External Connectors
Set<ForgeDirection> externalDirs = new HashSet<ForgeDirection>();
for (IConduit con : conduits) {
Set<ForgeDirection> extCons = con.getExternalConnections();
if(extCons != null) {
for (ForgeDirection dir : extCons) {
if(con.getConnectionMode(dir) != ConnectionMode.DISABLED) {
externalDirs.add(dir);
}
}
}
}
for (ForgeDirection dir : externalDirs) {
BoundingBox bb = ConduitGeometryUtil.instance.getExternalConnectorBoundingBox(dir);
CollidableComponent cc = new CollidableComponent(null, bb, dir, ConduitConnectorType.EXTERNAL);
result.add(cc);
cachedConnectors.add(cc);
}
connectorsDirty = false;