@@ -37,6 +37,7 @@ import com.lambda.module.Module
3737import com.lambda.module.tag.ModuleTag
3838import com.lambda.util.BlockUtils.blockPos
3939import com.lambda.util.BlockUtils.blockState
40+ import com.lambda.util.BlockUtils.isNotEmpty
4041import com.lambda.util.KeyCode
4142import com.lambda.util.KeyboardUtils.isKeyPressed
4243import com.lambda.util.NamedEnum
@@ -81,11 +82,12 @@ object Scaffold : Module(
8182 .simulate(player.eyePos, interactionConfig, rotationConfig, inventoryConfig, buildConfig)
8283 .filterIsInstance<PlaceResult .Place >()
8384 .let { results ->
84- val contexts = results
85+ val context = results
8586 .map { it.context }
8687 .distinctBy { it.blockPos }
8788 .sortedWith { o1, o2 -> getBridgeCompareBy(beneath).compare(o1, o2) }
88- submit(PlaceRequest (contexts, pendingActions, buildConfig, hotbarConfig, rotationConfig))
89+ .firstOrNull() ? : return @listen
90+ submit(PlaceRequest (setOf (context), pendingActions, buildConfig, hotbarConfig, rotationConfig))
8991 }
9092 }
9193 }
@@ -115,9 +117,11 @@ object Scaffold : Module(
115117 Direction .entries.forEach { direction ->
116118 val offset = blockPos.offset(direction)
117119 val offsetState = blockState(offset)
118- if (! offsetState.isReplaceable ) potentials.add(offset)
120+ if (offsetState.isNotEmpty ) potentials.add(offset)
119121 }
120122 val trueCenter = center.toCenterPos()
121- return potentials.any { it.toCenterPos() distSq trueCenter > blockPos.toCenterPos() distSq trueCenter }
123+ return potentials.isEmpty() || potentials.any {
124+ it.toCenterPos() distSq trueCenter > blockPos.toCenterPos() distSq trueCenter
125+ }
122126 }
123127}
0 commit comments