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