diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java index 7333b4228..377061269 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java @@ -195,19 +195,22 @@ public abstract class AbstractDataSourceHandler + try { - DhSectionPos chunkSectionPos = chunkDataView.getSectionPos(); - LodUtil.assertTrue(chunkSectionPos.overlapsExactly(pos), "Update failed, chunk [" + chunkSectionPos + "] does not overlap section [" + pos + "]."); - - // update this pos - this.updateDataSourceAtPos(pos, chunkDataView); - - // recursively update the parent pos - DhSectionPos parentPos = pos.getParentPos(); - this.recursivelyUpdateDataSourcesAsync(parentPos, chunkDataView); - - }); + executor.execute(() -> + { + DhSectionPos chunkSectionPos = chunkDataView.getSectionPos(); + LodUtil.assertTrue(chunkSectionPos.overlapsExactly(pos), "Update failed, chunk [" + chunkSectionPos + "] does not overlap section [" + pos + "]."); + + // update this pos + this.updateDataSourceAtPos(pos, chunkDataView); + + // recursively update the parent pos + DhSectionPos parentPos = pos.getParentPos(); + this.recursivelyUpdateDataSourcesAsync(parentPos, chunkDataView); + }); + } + catch (RejectedExecutionException ignore) { /* can happen if the executor was shutdown while this task was queued */ } } protected void updateDataSourceAtPos(DhSectionPos pos, ChunkSizedFullDataAccessor chunkData) {