private final BoundingBoxCache boundingBoxCache;
- private void addStructures(BoundingBoxType type, Map<String, StructureStart> structureMap) {
- StructureStart structureStart = structureMap.get(type.getName());
+ private void addStructures(BoundingBoxType type, StructureStart<?> structureStart) {
if (structureStart == null) return;
- BlockBox bb = structureStart.getBoundingBox();
+ if (structureStart.hasNoChildren()) return;
+
+ BlockBox bb = structureStart.setBoundingBoxFromChildren();
if (bb == null) return;
AbstractBoundingBox boundingBox = buildStructure(bb, type);
}
private AbstractBoundingBox buildStructure(BlockBox bb, BoundingBoxType type) {
- Coords min = new Coords(bb.minX, bb.minY, bb.minZ);
- Coords max = new Coords(bb.maxX, bb.maxY, bb.maxZ);
+ Coords min = new Coords(bb.getMinX(), bb.getMinY(), bb.getMinZ());
+ Coords max = new Coords(bb.getMaxX(), bb.getMaxY(), bb.getMaxZ());
return BoundingBoxCuboid.from(min, max, type);
}
- void process(Map<String, StructureStart> structures) {
+ void process(Map<String, StructureStart<?>> structures) {
if (structures.size() > 0) {
- supportedStructures.forEach(type -> addStructures(type, structures));
+ supportedStructures.forEach(type -> addStructures(type, structures.get(type.getName())));
}
}
}