From 0347730580e0dd67bafa38d6c13c9785cd375257 Mon Sep 17 00:00:00 2001 From: trivernis Date: Mon, 13 Apr 2020 21:31:26 +0200 Subject: [PATCH] Improve performance of periodical chunk progress saving task --- .../trivernis/chunkmaster/lib/generation/GenerationManager.kt | 4 ++-- .../trivernis/chunkmaster/lib/generation/GenerationTask.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationManager.kt b/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationManager.kt index af94091..cb82eb4 100644 --- a/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationManager.kt +++ b/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationManager.kt @@ -307,8 +307,8 @@ class GenerationManager(private val chunkmaster: Chunkmaster, private val server percentage, eta, chunkSpeed!!, - genTask.lastChunk.x, - genTask.lastChunk.z)) + genTask.lastChunkCoords.x, + genTask.lastChunkCoords.z)) saveProgressToDatabase(genTask.lastChunkCoords, task.id) genTask.updateLastChunkMarker() } catch (error: Exception) { diff --git a/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTask.kt b/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTask.kt index 50b6447..9178372 100644 --- a/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTask.kt +++ b/src/main/kotlin/net/trivernis/chunkmaster/lib/generation/GenerationTask.kt @@ -116,8 +116,8 @@ abstract class GenerationTask( markerSet?.creUpdateAreMarker( markerLastId, markerLastName, - this.lastChunk.getBlock(0, 0, 0).location, - this.lastChunk.getBlock(15, 0, 15).location, + this.lastChunkCoords.getCenterLocation(world).chunk.getBlock(0, 0, 0).location, + this.lastChunkCoords.getCenterLocation(world).chunk.getBlock(15, 0, 15).location, markerLastStyle ) }