Skip to content

Commit e6674ba

Browse files
committed
descend setting
1 parent bacf47b commit e6674ba

File tree

1 file changed

+6
-1
lines changed
  • src/main/kotlin/com/lambda/module/modules/player

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ import com.lambda.interaction.request.Request.Companion.submit
3434
import com.lambda.interaction.request.placing.PlaceRequest
3535
import com.lambda.module.Module
3636
import com.lambda.module.tag.ModuleTag
37+
import com.lambda.util.KeyCode
38+
import com.lambda.util.KeyboardUtils.isKeyPressed
3739
import com.lambda.util.NamedEnum
3840
import com.lambda.util.world.raycast.InteractionMask
41+
import net.minecraft.util.math.Direction
3942
import java.util.concurrent.ConcurrentLinkedQueue
4043

4144
object Scaffold : Module(
@@ -44,13 +47,15 @@ object Scaffold : Module(
4447
tag = ModuleTag.PLAYER,
4548
) {
4649
private enum class Group(override val displayName: String) : NamedEnum {
50+
General("General"),
4751
Build("Build"),
4852
Rotation("Rotation"),
4953
Interaction("Interaction"),
5054
Hotbar("Hotbar"),
5155
Inventory("Inventory")
5256
}
5357

58+
private val descend by setting("Descend", KeyCode.UNBOUND, "Lower the place position by one to allow the player to lower y level").group(Group.General)
5459
private val buildConfig = BuildSettings(this, Group.Build)
5560
private val rotationConfig = RotationSettings(this, Group.Rotation)
5661
private val interactionConfig = InteractionSettings(this, Group.Interaction, InteractionMask.Block)
@@ -63,7 +68,7 @@ object Scaffold : Module(
6368
listen<TickEvent.Pre> {
6469
player
6570
.blockPos
66-
.down()
71+
.offset(Direction.DOWN, if (isKeyPressed(descend.code)) 2 else 1)
6772
.toStructure(TargetState.Solid)
6873
.toBlueprint()
6974
.simulate(player.eyePos, interactionConfig, rotationConfig, inventoryConfig, buildConfig)

0 commit comments

Comments
 (0)