diff --git a/src/main/java/baritone/cache/CachedWorld.java b/src/main/java/baritone/cache/CachedWorld.java index db626aca7..cb05360b5 100644 --- a/src/main/java/baritone/cache/CachedWorld.java +++ b/src/main/java/baritone/cache/CachedWorld.java @@ -142,7 +142,11 @@ public final class CachedWorld implements ICachedWorld, Helper { public final void save() { if (!Baritone.settings().chunkCaching.get()) { System.out.println("Not saving to disk; chunk caching is disabled."); - allRegions().forEach(CachedRegion::removeExpired); // even if we aren't saving to disk, still delete expired old chunks from RAM + allRegions().forEach(region -> { + if (region != null) { + region.removeExpired(); + } + }); // even if we aren't saving to disk, still delete expired old chunks from RAM return; } long start = System.nanoTime() / 1000000L;