Revert optimizations on spigot

Revert the optimizations which check if the chunk is already generated because
the function doesn't report the right value.
https://hub.spigotmc.org/jira/browse/SPIGOT-5541?attachmentOrder=desc
pull/55/head
trivernis 5 years ago
parent be130adc6f
commit c090977021

@ -59,7 +59,7 @@ class GenerationTaskPaper(
}
}
lastChunkCoords = chunk
count = shape.count // set the count to the more accurate spiral count
count = shape.count
}
}
checkChunksLoaded()

@ -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
}

@ -35,6 +35,9 @@ class Circle(center: Pair<Int, Int>, start: Pair<Int, Int>, radius: Int): Shape(
}
override fun next(): Pair<Int, Int> {
if (endReached()) {
return currentPos
}
if (count == 0 && currentPos != center) {
val tmpCircle = Circle(center, center, radius)
while (tmpCircle.next() != currentPos);

Loading…
Cancel
Save