Skip to content

Commit a18a3b0

Browse files
committed
Slightly reduce overplacing
1 parent 76958bf commit a18a3b0

File tree

1 file changed

+5
-3
lines changed
  • src/main/kotlin/com/lambda/module/modules/player

1 file changed

+5
-3
lines changed

src/main/kotlin/com/lambda/module/modules/player/Scaffold.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import com.lambda.util.NamedEnum
4343
import com.lambda.util.math.distSq
4444
import com.lambda.util.world.raycast.InteractionMask
4545
import net.minecraft.util.math.BlockPos
46-
import net.minecraft.util.math.Direction
4746
import java.util.concurrent.ConcurrentLinkedQueue
4847

4948
object Scaffold : Module(
@@ -74,8 +73,11 @@ object Scaffold : Module(
7473

7574
init {
7675
listen<TickEvent.Pre> {
77-
val offset = if (isKeyPressed(descend.code)) descendAmount + 1 else 1
78-
val beneath = player.blockPos.offset(Direction.DOWN, offset)
76+
val playerSupport = player.blockPos.down()
77+
val alreadySupported = blockState(playerSupport).hasSolidTopSurface(world, playerSupport, player)
78+
if (alreadySupported) return@listen
79+
val offset = if (isKeyPressed(descend.code)) descendAmount else 0
80+
val beneath = playerSupport.down(offset)
7981
scaffoldPositions(beneath)
8082
.associateWith { TargetState.Solid }
8183
.toBlueprint()

0 commit comments

Comments
 (0)