diff --git a/core/src/main/java/de/bluecolored/bluemap/core/map/renderstate/CellStorage.java b/core/src/main/java/de/bluecolored/bluemap/core/map/renderstate/CellStorage.java index 713a696e..a4336d94 100644 --- a/core/src/main/java/de/bluecolored/bluemap/core/map/renderstate/CellStorage.java +++ b/core/src/main/java/de/bluecolored/bluemap/core/map/renderstate/CellStorage.java @@ -92,7 +92,17 @@ private synchronized T loadCell(Vector2i pos) { return BLUE_NBT.read(in.decompress(), type); } catch (IOException ex) { Logger.global.logError("Failed to load render-state cell " + pos, ex); + } catch (RuntimeException ex) { // E.g. NoSuchElementException thrown by BlueNBT if there is a format error + Logger.global.logError("Failed to load render-state cell " + pos, ex); + + // try to delete the possibly corrupted file for self-healing + try { + storage.delete(pos.getX(), pos.getY()); + } catch (IOException e) { + Logger.global.logError("Failed to delete render-state cell " + pos, e); + } } + return createNewCell(); }