From 1206126b422255c924a134562d9bac14f11fd082 Mon Sep 17 00:00:00 2001 From: Daniel Orr Date: Tue, 2 Jul 2024 12:31:08 +0100 Subject: [PATCH] Synchronise complete placement logic --- gradle.properties | 2 +- .../net/mcbrawls/blueprint/structure/Blueprint.kt | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index 04d6c7b..389fea7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_build=7 loader_version=0.15.11 # Mod Properties -mod_version=1.5.2 +mod_version=1.5.3 maven_group=net.mcbrawls mod_id=blueprint diff --git a/src/main/kotlin/net/mcbrawls/blueprint/structure/Blueprint.kt b/src/main/kotlin/net/mcbrawls/blueprint/structure/Blueprint.kt index 57193fc..f9c563f 100644 --- a/src/main/kotlin/net/mcbrawls/blueprint/structure/Blueprint.kt +++ b/src/main/kotlin/net/mcbrawls/blueprint/structure/Blueprint.kt @@ -65,17 +65,16 @@ data class Blueprint( val progress = AtomicReference(0.0f) val future: CompletableFuture = CompletableFuture.supplyAsync { - var i = 0 - forEach { offset, state -> - synchronized(world) { + synchronized(world) { + var i = 0 + forEach { offset, state -> world.setBlockState(position.add(offset), state) + i++ } - i++ + progress.set(i.toFloat() / totalBlocks) } - progress.set(i.toFloat() / totalBlocks) - PlacedBlueprint(this, position) }