From 538965e74a77c3350ab3dafae38b7d7c08c54c2c Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Tue, 30 Jun 2020 20:36:43 +0200 Subject: [PATCH] Crash when someone tries to overwrite existing grid cache implementations. --- .../java/appeng/core/features/registries/GridCacheRegistry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java index ab53f7999..f60386214 100644 --- a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java +++ b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java @@ -40,7 +40,7 @@ public final class GridCacheRegistry implements IGridCacheRegistry { @Nonnull IGridCacheFactory factory) { if (registry.stream().anyMatch(r -> r.cacheClass.equals(iface))) { - AELog.debug("Overriding grid cache factory for cache type %s", iface); + throw new IllegalArgumentException("Implementation for grid cache "+ iface + " is already registered!"); } registry.add(new GridCacheRegistration<>(iface, factory));