@@ -59,6 +59,7 @@ object Scaffold : Module(
59
59
private var lastHitVec: Vec3d ? = null
60
60
private var placeInfo: PlaceInfo ? = null
61
61
private var inactiveTicks = 69
62
+ private var towerTimer: TickTimer = TickTimer (TimeUnit .TICKS )
62
63
63
64
private enum class ScaffoldBlockSelectionMode (override val displayName : String ): DisplayEnum {
64
65
ANY (" Any" ),
@@ -71,6 +72,11 @@ object Scaffold : Module(
71
72
}
72
73
73
74
init {
75
+
76
+ onEnable {
77
+ towerTimer.reset()
78
+ }
79
+
74
80
onDisable {
75
81
placeInfo = null
76
82
inactiveTicks = 69
@@ -89,6 +95,9 @@ object Scaffold : Module(
89
95
val rotation = getRotationTo(it.hitVec)
90
96
event.rotation = rotation
91
97
}
98
+ if (placeInfo == null ) {
99
+ towerTimer.reset()
100
+ }
92
101
} else if (event.phase == Phase .POST ) {
93
102
placeInfo?.let { pi ->
94
103
if (swap()) {
@@ -98,7 +107,12 @@ object Scaffold : Module(
98
107
placeBlock(pi, noGhost = false ) // noGhost true usually causes problems and has no real benefit here
99
108
if (shouldSneak) connection.sendPacket(CPacketEntityAction (player, CPacketEntityAction .Action .STOP_SNEAKING ))
100
109
mc.player.jump()
110
+ if (towerTimer.tick(30 )) {
111
+ // reset pos back onto top block
112
+ mc.player.motionY = - 0.3
113
+ }
101
114
} else {
115
+ towerTimer.reset()
102
116
if (placeTimer.tick(delay, true )) {
103
117
val shouldSneak = sneak && ! player.isSneaking
104
118
if (shouldSneak) connection.sendPacket(CPacketEntityAction (player, CPacketEntityAction .Action .START_SNEAKING ))
0 commit comments