Skip to content

Commit 54cce2a

Browse files
authored
Fix chunk snapshots creation and update version to 3.9.3 (#336)
2 parents f476d16 + e044588 commit 54cce2a

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
77
javaVersion=25
88
mcVersion=26.1.1
99
group=dev.slne.surf.api
10-
version=3.9.2
10+
version=3.9.3
1111
relocationPrefix=dev.slne.surf.api.libs
1212
snapshot=false

surf-api-paper/surf-api-paper-server/src/main/kotlin/dev/slne/surf/api/paper/server/impl/visualizer/visualizer/SurfVisualizerAreaImpl.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,11 @@ class SurfVisualizerAreaImpl(
264264
val cx = getXFromChunkKey(chunkKey)
265265
val cz = getZFromChunkKey(chunkKey)
266266

267-
val chunk = world.getChunkAtAsync(cx, cz).await()
268-
val snapshot = chunk.getChunkSnapshot(true, false, false, false)
269-
snapshotCache.put(chunkKey, snapshot)
270-
return snapshot
267+
return world.getChunkAtAsync(cx, cz).thenApply { chunk ->
268+
chunk.getChunkSnapshot(true, false, false, false).also {
269+
snapshotCache.put(chunkKey, it)
270+
}
271+
}.await()
271272
}
272273

273274
fun onChunkBecameVisible(player: Player, chunk: Chunk) {

0 commit comments

Comments
 (0)