@@ -193,26 +193,26 @@ class WorldPreparationManager(private val plugin: ChallengePluginPlugin) {
193
193
future : CompletableFuture <Boolean >
194
194
) {
195
195
val chunkyAPI = Bukkit .getServicesManager().load(ChunkyAPI ::class .java)
196
-
196
+
197
197
if (chunkyAPI == null ) {
198
198
plugin.logger.warning(" Chunky API not available, skipping chunk pregeneration" )
199
199
finalizeWorldPreparation(world, netherWorld, endWorld, worldName, netherName, endName, future)
200
200
return
201
201
}
202
202
203
203
plugin.logger.info(" Starting chunk pregeneration for world set: $worldName " )
204
-
204
+
205
205
var completedWorlds = 0
206
206
val totalWorlds = 3
207
-
207
+
208
208
val onWorldCompleted = {
209
209
completedWorlds++
210
210
if (completedWorlds >= totalWorlds) {
211
211
plugin.logger.info(" Chunk pregeneration completed for all worlds in set: $worldName " )
212
212
finalizeWorldPreparation(world, netherWorld, endWorld, worldName, netherName, endName, future)
213
213
}
214
214
}
215
-
215
+
216
216
chunkyAPI.onGenerationComplete { event ->
217
217
when (event.world()) {
218
218
worldName, netherName, endName -> {
@@ -221,12 +221,12 @@ class WorldPreparationManager(private val plugin: ChallengePluginPlugin) {
221
221
}
222
222
}
223
223
}
224
-
224
+
225
225
// Start chunk generation for overworld (1000x1000 = 500 radius)
226
226
if (! chunkyAPI.startTask(worldName, " square" , 0.0 , 0.0 , 500.0 , 500.0 , " concentric" )) {
227
227
plugin.logger.warning(" Failed to start chunk pregeneration for $worldName " )
228
228
}
229
-
229
+
230
230
// Start chunk generation for nether
231
231
if (netherWorld != null ) {
232
232
if (! chunkyAPI.startTask(netherName, " square" , 0.0 , 0.0 , 500.0 , 500.0 , " concentric" )) {
@@ -236,7 +236,7 @@ class WorldPreparationManager(private val plugin: ChallengePluginPlugin) {
236
236
plugin.logger.warning(" Cannot prepare chunks for nether. Nether not found." )
237
237
onWorldCompleted()
238
238
}
239
-
239
+
240
240
// Start chunk generation for end
241
241
if (endWorld != null ) {
242
242
if (! chunkyAPI.startTask(endName, " square" , 0.0 , 0.0 , 500.0 , 500.0 , " concentric" )) {
0 commit comments