diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java index de0552ae3..69f5155a5 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/worldGeneration/BatchGenerationEnvironment.java @@ -42,6 +42,8 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.worldGeneration.Abstrac import com.seibel.distanthorizons.common.wrappers.chunk.ChunkWrapper; import java.io.IOException; +import java.nio.channels.ClosedByInterruptException; +import java.nio.channels.ClosedChannelException; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicReference; @@ -681,12 +683,25 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv actualThrowable = completionException.getCause(); } - CHUNK_LOAD_LOGGER.warn("DistantHorizons: Couldn't load or make chunk ["+chunkPos+"], error: ["+actualThrowable.getMessage()+"].", actualThrowable); + // interrupts mean the world generator is being shut down, no need to log that + boolean isShutdownException = + actualThrowable instanceof InterruptedException + || actualThrowable instanceof ClosedByInterruptException; + if (!isShutdownException) + { + CHUNK_LOAD_LOGGER.warn("DistantHorizons: Couldn't load or make chunk ["+chunkPos+"], error: ["+actualThrowable.getMessage()+"].", actualThrowable); + } + return null; }); } #endif } + catch (ClosedByInterruptException ignore) + { + // this just means the world generator is being shut down + return CompletableFuture.completedFuture(null); + } catch (Exception e) { CHUNK_LOAD_LOGGER.warn("DistantHorizons: Couldn't load or make chunk [" + chunkPos + "]. Error: [" + e.getMessage() + "].", e); @@ -1124,9 +1139,10 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv { regionStorage.close(); } + catch (ClosedChannelException ignore) { /* world generator is being shut down */ } catch (IOException e) { - EVENT_LOGGER.error("Failed to close region file storage cache!", e); + EVENT_LOGGER.error("Failed to close region file storage cache, error: ["+e.getMessage()+"].", e); } } diff --git a/coreSubProjects b/coreSubProjects index 6fe0df7d0..b82a59ecb 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 6fe0df7d0fd32c0a6e42343d6c1e104f4369726f +Subproject commit b82a59ecbc5bd070eec4f22f808dceb837514f5e