From 119fa9bc299995b076805ef699a4c1ac7e6f8a12 Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Sun, 22 Jan 2023 20:57:18 -0800 Subject: [PATCH] Fix tower teleports by moving back onto top block --- .../lambda/client/module/modules/player/Scaffold.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/kotlin/com/lambda/client/module/modules/player/Scaffold.kt b/src/main/kotlin/com/lambda/client/module/modules/player/Scaffold.kt index add3ab33c..25e4505a4 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/player/Scaffold.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/player/Scaffold.kt @@ -59,6 +59,7 @@ object Scaffold : Module( private var lastHitVec: Vec3d? = null private var placeInfo: PlaceInfo? = null private var inactiveTicks = 69 + private var towerTimer: TickTimer = TickTimer(TimeUnit.TICKS) private enum class ScaffoldBlockSelectionMode(override val displayName: String): DisplayEnum { ANY("Any"), @@ -71,6 +72,11 @@ object Scaffold : Module( } init { + + onEnable { + towerTimer.reset() + } + onDisable { placeInfo = null inactiveTicks = 69 @@ -98,7 +104,12 @@ object Scaffold : Module( placeBlock(pi, noGhost = false) // noGhost true usually causes problems and has no real benefit here if (shouldSneak) connection.sendPacket(CPacketEntityAction(player, CPacketEntityAction.Action.STOP_SNEAKING)) mc.player.jump() + if (towerTimer.tick(30)) { + // reset pos back onto top block + mc.player.motionY = -0.3 + } } else { + towerTimer.reset() if (placeTimer.tick(delay, true)) { val shouldSneak = sneak && !player.isSneaking if (shouldSneak) connection.sendPacket(CPacketEntityAction(player, CPacketEntityAction.Action.START_SNEAKING))