hopefully prevent world gen structure lockup when leaving the world
This commit is contained in:
+1
-2
@@ -36,7 +36,6 @@ import com.seibel.distanthorizons.core.pos.DhChunkPos;
|
||||
import com.seibel.distanthorizons.core.util.objects.EventTimer;
|
||||
import com.seibel.distanthorizons.core.util.LodUtil;
|
||||
import com.seibel.distanthorizons.core.util.gridList.ArrayGridList;
|
||||
import com.seibel.distanthorizons.core.util.objects.DhThreadFactory;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.worldGeneration.AbstractBatchGenerationEnvironmentWrapper;
|
||||
import com.seibel.distanthorizons.common.wrappers.chunk.ChunkWrapper;
|
||||
@@ -745,7 +744,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
|
||||
* This is necessary to allow canceling world gen since waiting
|
||||
* for some world gen requests to finish can take a while.
|
||||
*/
|
||||
private static void throwIfThreadInterrupted() throws InterruptedException
|
||||
public static void throwIfThreadInterrupted() throws InterruptedException
|
||||
{
|
||||
if (Thread.interrupted())
|
||||
{
|
||||
|
||||
+6
-1
@@ -64,7 +64,7 @@ public final class StepStructureStart
|
||||
|
||||
public void generateGroup(
|
||||
ThreadedParameters tParams, WorldGenRegion worldGenRegion,
|
||||
List<ChunkWrapper> chunkWrappers)
|
||||
List<ChunkWrapper> chunkWrappers) throws InterruptedException
|
||||
{
|
||||
ArrayList<ChunkAccess> chunksToDo = new ArrayList<>();
|
||||
|
||||
@@ -90,6 +90,11 @@ public final class StepStructureStart
|
||||
for (ChunkAccess chunk : chunksToDo)
|
||||
{
|
||||
// System.out.println("StepStructureStart: "+chunk.getPos());
|
||||
|
||||
// there are a few cases where the structure generator call may lock up (either due to teleporting or leaving the world).
|
||||
// hopefully allowing interrupts here will prevent that from happening.
|
||||
BatchGenerationEnvironment.throwIfThreadInterrupted();
|
||||
|
||||
#if PRE_MC_1_19_2
|
||||
environment.params.generator.createStructures(environment.params.registry, tParams.structFeat, chunk, environment.params.structures,
|
||||
environment.params.worldSeed);
|
||||
|
||||
+1
-1
Submodule coreSubProjects updated: 91f67cac9b...859fcaf1b8
Reference in New Issue
Block a user