use of com.irtimaled.bbor.common.models.AbstractBoundingBox in project BoundingBoxOutlineReloaded by irtimaled.
the class CacheProvider method get.
@Override
public Iterable<AbstractBoundingBox> get(DimensionId dimensionId) {
Boolean outerBoxesOnly = ConfigManager.outerBoxesOnly.get();
Set<AbstractBoundingBox> boundingBoxes = new HashSet<>();
BoundingBoxCache cache = getCache.apply(dimensionId);
if (cache != null) {
for (Map.Entry<AbstractBoundingBox, Set<AbstractBoundingBox>> entry : cache.getBoundingBoxes().entrySet()) {
AbstractBoundingBox key = entry.getKey();
if (BoundingBoxTypeHelper.shouldRender(key.getType()) && isWithinRenderDistance(key)) {
if (!outerBoxesOnly) {
Set<AbstractBoundingBox> children = entry.getValue();
if (children != null && children.size() > 0) {
boundingBoxes.addAll(children);
continue;
}
}
boundingBoxes.add(key);
}
}
}
return boundingBoxes;
}
Aggregations