import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-public class CustomBoxProvider implements IBoundingBoxProvider<BoundingBoxCuboid> {
+public class CustomBoxProvider implements IBoundingBoxProvider<BoundingBoxCuboid>, ICachingProvider {
private static final Map<DimensionId, Map<Integer, BoundingBoxCuboid>> dimensionCache = new HashMap<>();
private static int getHashKey(Coords minCoords, Coords maxCoords) {
dimensionCache.values().forEach(Map::clear);
}
+ public void clearCache() {
+ clear();
+ }
+
@Override
public Iterable<BoundingBoxCuboid> get(DimensionId dimensionId) {
return getCache(dimensionId).values();