@@ -59,6 +59,7 @@ object Scaffold : Module(
5959 private var lastHitVec: Vec3d ? = null
6060 private var placeInfo: PlaceInfo ? = null
6161 private var inactiveTicks = 69
62+ private var towerTimer: TickTimer = TickTimer (TimeUnit .TICKS )
6263
6364 private enum class ScaffoldBlockSelectionMode (override val displayName : String ): DisplayEnum {
6465 ANY (" Any" ),
@@ -71,6 +72,11 @@ object Scaffold : Module(
7172 }
7273
7374 init {
75+
76+ onEnable {
77+ towerTimer.reset()
78+ }
79+
7480 onDisable {
7581 placeInfo = null
7682 inactiveTicks = 69
@@ -89,6 +95,9 @@ object Scaffold : Module(
8995 val rotation = getRotationTo(it.hitVec)
9096 event.rotation = rotation
9197 }
98+ if (placeInfo == null ) {
99+ towerTimer.reset()
100+ }
92101 } else if (event.phase == Phase .POST ) {
93102 placeInfo?.let { pi ->
94103 if (swap()) {
@@ -98,7 +107,12 @@ object Scaffold : Module(
98107 placeBlock(pi, noGhost = false ) // noGhost true usually causes problems and has no real benefit here
99108 if (shouldSneak) connection.sendPacket(CPacketEntityAction (player, CPacketEntityAction .Action .STOP_SNEAKING ))
100109 mc.player.jump()
110+ if (towerTimer.tick(30 )) {
111+ // reset pos back onto top block
112+ mc.player.motionY = - 0.3
113+ }
101114 } else {
115+ towerTimer.reset()
102116 if (placeTimer.tick(delay, true )) {
103117 val shouldSneak = sneak && ! player.isSneaking
104118 if (shouldSneak) connection.sendPacket(CPacketEntityAction (player, CPacketEntityAction .Action .START_SNEAKING ))
0 commit comments