Skip to content

Commit 1ca6f04

Browse files
MeldexunDerToaster98
authored andcommitted
Added config option for multithreaded dungeon preparation
(cherry picked from commit 3a214e9)
1 parent bdb3fd7 commit 1ca6f04

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/main/java/com/teamcqr/chocolatequestrepoured/structuregen/dungeons/DungeonBase.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.teamcqr.chocolatequestrepoured.structuregen.DungeonGeneratorThread;
1313
import com.teamcqr.chocolatequestrepoured.structuregen.generators.AbstractDungeonGenerator;
1414
import com.teamcqr.chocolatequestrepoured.structuregen.inhabitants.DungeonInhabitantManager;
15+
import com.teamcqr.chocolatequestrepoured.util.CQRConfig;
1516
import com.teamcqr.chocolatequestrepoured.util.DungeonGenUtils;
1617
import com.teamcqr.chocolatequestrepoured.util.PropertyFileHelper;
1718

@@ -151,8 +152,11 @@ public void generate(World world, int x, int z) {
151152
}
152153

153154
public void generate(World world, int x, int y, int z) {
154-
new DungeonGeneratorThread(this.createDungeonGenerator(world, x, y, z)).start();
155-
//this.createDungeonGenerator(world, x, y, z).generate();
155+
if (CQRConfig.advanced.multithreadedDungeonPreparation) {
156+
new DungeonGeneratorThread(this.createDungeonGenerator(world, x, y, z)).start();
157+
} else {
158+
this.createDungeonGenerator(world, x, y, z).generate();
159+
}
156160
}
157161

158162
public void generateWithOffsets(World world, int x, int y, int z) {

src/main/java/com/teamcqr/chocolatequestrepoured/util/CQRConfig.java

+3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ public static class Advanced {
8686
public double generationMinDistanceToOtherStructure = 64;
8787
@Config.Comment("If the dungeon generation process should also respect non explored (vanilla) structures")
8888
public boolean generationRespectUnexploredStructures = true;
89+
90+
@Config.Comment("Enable/Disable multithreaded dungeon preparation. When enabled the calculations to prepare a dungeon for generation are done on another thread.")
91+
public boolean multithreadedDungeonPreparation = true;
8992
}
9093

9194
public static class Bosses {

0 commit comments

Comments
 (0)