diff --git a/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTaskPaper.kt b/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTaskPaper.kt index a349c07..5e8d92f 100644 --- a/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTaskPaper.kt +++ b/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTaskPaper.kt @@ -59,7 +59,7 @@ class GenerationTaskPaper( } } lastChunkCoords = chunk - count = shape.count // set the count to the more accurate spiral count + count = shape.count } } checkChunksLoaded() diff --git a/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTaskSpigot.kt b/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTaskSpigot.kt index 8e3b64a..5dfbd10 100644 --- a/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTaskSpigot.kt +++ b/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTaskSpigot.kt @@ -34,26 +34,17 @@ class GenerationTaskSpigot( if (borderReachedCheck()) return var chunk = nextChunkCoordinates - for (i in 0 until chunkSkips) { - if (world.isChunkGenerated(chunk.x, chunk.z)) { - chunk = nextChunkCoordinates - } else { - break - } - } - - if (!world.isChunkGenerated(chunk.x, chunk.z)) { - for (i in 0 until chunksPerStep) { - if (borderReached()) break - val chunkInstance = world.getChunkAt(chunk.x, chunk.z) - chunkInstance.load(true) - loadedChunks.add(chunkInstance) - chunk = nextChunkCoordinates - } + for (i in 0 until chunksPerStep) { + if (borderReached()) break val chunkInstance = world.getChunkAt(chunk.x, chunk.z) chunkInstance.load(true) loadedChunks.add(chunkInstance) + chunk = nextChunkCoordinates } + val chunkInstance = world.getChunkAt(chunk.x, chunk.z) + chunkInstance.load(true) + loadedChunks.add(chunkInstance) + lastChunkCoords = chunk count = shape.count } diff --git a/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Circle.kt b/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Circle.kt index 90bc9de..19aa335 100644 --- a/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Circle.kt +++ b/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Circle.kt @@ -35,6 +35,9 @@ class Circle(center: Pair, start: Pair, radius: Int): Shape( } override fun next(): Pair { + if (endReached()) { + return currentPos + } if (count == 0 && currentPos != center) { val tmpCircle = Circle(center, center, radius) while (tmpCircle.next() != currentPos);