diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/RegionFileStorageExternalCache.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/RegionFileStorageExternalCache.java index edbc1c89f..bcdd6f5ab 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/RegionFileStorageExternalCache.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/mimicObject/RegionFileStorageExternalCache.java @@ -21,6 +21,8 @@ public class RegionFileStorageExternalCache implements AutoCloseable { private static final Logger LOGGER = DhLoggerBuilder.getLogger(); + /** Can be null due to the C2ME mod */ + @Nullable public final RegionFileStorage storage; public static final int MAX_CACHE_SIZE = 16; @@ -56,6 +58,19 @@ public class RegionFileStorageExternalCache implements AutoCloseable @Nullable public RegionFile getRegionFile(ChunkPos pos) throws IOException { + if (this.storage == null) + { + if (!regionCacheNullPointerWarningSent) + { + regionCacheNullPointerWarningSent = true; + LOGGER.warn("Unable to access Minecraft's chunk cache. This may be due to another mod changing said cache. DH will be unable to access any Minecraft chunk data until said mod is removed."); + } + + return null; + } + + + long posLong = ChunkPos.asLong(pos.getRegionX(), pos.getRegionZ()); RegionFile rFile = null; diff --git a/coreSubProjects b/coreSubProjects index 163c0bf1f..b0c2874e7 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 163c0bf1fac5eb3f17406a6bcc0ed8ba5d5b041f +Subproject commit b0c2874e71cbb294ca7ce524d51c35e278bc1c92