Skip to content

Commit 50ae0e0

Browse files
committed
move ticking blueprint check to the top of tick pre
1 parent d7ac3d4 commit 50ae0e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/kotlin/com/lambda/task/tasks/BuildTask.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ class BuildTask @Ta5kBuilder constructor(
9494

9595
init {
9696
listen<TickEvent.Pre> {
97+
if (blueprint is TickingBlueprint) {
98+
blueprint.tick() ?: failure("Failed to tick the ticking blueprint")
99+
}
100+
97101
if (collectDrops()) return@listen
98102

99103
val results = blueprint.simulate(player.eyePos, interactionConfig, rotation, inventory, build)
@@ -191,10 +195,6 @@ class BuildTask @Ta5kBuilder constructor(
191195
}
192196

193197
listen<TickEvent.Post> {
194-
if (blueprint is TickingBlueprint) {
195-
blueprint.tick() ?: failure("Failed to tick the ticking blueprint")
196-
}
197-
198198
if (finishOnDone && blueprint.structure.isEmpty()) {
199199
failure("Structure is empty")
200200
return@listen

0 commit comments

Comments
 (0)