Skip to content

Commit e93d412

Browse files
committed
inlined killaura target
1 parent 63f358f commit e93d412

File tree

1 file changed

+2
-16
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/combat

1 file changed

+2
-16
lines changed

common/src/main/kotlin/com/lambda/module/modules/combat/KillAura.kt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ import com.lambda.interaction.visibilty.VisibilityChecker.scanSurfaces
3535
import com.lambda.interaction.visibilty.VisibilityChecker.visibleSides
3636
import com.lambda.module.Module
3737
import com.lambda.module.tag.ModuleTag
38-
import com.lambda.threading.runConcurrent
39-
import com.lambda.threading.runSafe
4038
import com.lambda.util.math.MathUtils.random
4139
import com.lambda.util.math.VecUtils.distSq
4240
import com.lambda.util.math.VecUtils.plus
@@ -45,7 +43,6 @@ import com.lambda.util.math.lerp
4543
import com.lambda.util.player.MovementUtils.moveDiff
4644
import com.lambda.util.player.prediction.buildPlayerPrediction
4745
import com.lambda.util.world.raycast.RayCastUtils.entityResult
48-
import kotlinx.coroutines.delay
4946
import net.minecraft.entity.EquipmentSlot
5047
import net.minecraft.entity.LivingEntity
5148
import net.minecraft.entity.attribute.EntityAttributeModifier
@@ -89,7 +86,8 @@ object KillAura : Module(
8986
private val selfPredict by setting("Self Predict", 1.0, 0.0..2.0, 0.1) { page == Page.Aiming && rotate }
9087
private val targetPredict by setting("Target Predict", 0.0, 0.0..2.0, 0.1) { page == Page.Aiming && rotate }
9188

92-
var target: LivingEntity? = null; private set
89+
val target: LivingEntity?
90+
get() = targeting.target()
9391

9492
private var shakeRandom = Vec3d.ZERO
9593

@@ -131,24 +129,13 @@ object KillAura : Module(
131129
}
132130

133131
listen<TickEvent.Pre> {
134-
target = targeting.target()
135132
if (!timerSync) attackTicks++
136133

137134
target?.let { entity ->
138135
runAttack(entity)
139136
}
140137
}
141138

142-
runConcurrent {
143-
while (true) {
144-
delay(50) // ToDo: tps sync
145-
146-
runSafe {
147-
if (timerSync && isEnabled) attackTicks++
148-
}
149-
}
150-
}
151-
152139
listen<PacketEvent.Send.Post> { event ->
153140
if (event.packet !is HandSwingC2SPacket &&
154141
event.packet !is UpdateSelectedSlotC2SPacket &&
@@ -327,7 +314,6 @@ object KillAura : Module(
327314
}
328315

329316
private fun reset(ctx: SafeContext) = ctx.apply {
330-
target = null
331317
attackTicks = player.lastAttackedTicks
332318
rotation.speedMultiplier = 1.0
333319
shakeRandom = Vec3d.ZERO

0 commit comments

Comments
 (0)