Skip to content

Commit

Permalink
delete TimeBalancer && KKCraft Velocity rename to AAC5.2Reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
XeContrast committed Nov 16, 2024
1 parent 09be620 commit 44976e0
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 191 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ processResources {

rename "(.+_at.cfg)", "META-INF/\$1"
}

1L
task moveResources {
doLast {
ant.move file: "${buildDir}/resources/main",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import net.ccbluex.liquidbounce.features.module.ModuleInfo
import net.ccbluex.liquidbounce.features.module.modules.movement.Flight
import net.ccbluex.liquidbounce.features.module.modules.movement.StrafeFix
import net.ccbluex.liquidbounce.features.module.modules.movement.TargetStrafe
import net.ccbluex.liquidbounce.features.module.modules.player.Blink
import net.ccbluex.liquidbounce.features.module.modules.visual.FreeCam
import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.Scaffold
import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.Scaffold2
Expand All @@ -29,13 +28,13 @@ import net.ccbluex.liquidbounce.utils.*
import net.ccbluex.liquidbounce.utils.ClientUtils.runTimeTicks
import net.ccbluex.liquidbounce.utils.EntityUtils.isLookingOnEntities
import net.ccbluex.liquidbounce.utils.EntityUtils.rotation
import net.ccbluex.liquidbounce.utils.RaycastUtils.raycastEntity
import net.ccbluex.liquidbounce.utils.RotationUtils.Companion.getVectorForRotation
import net.ccbluex.liquidbounce.utils.RotationUtils.Companion.isVisible
import net.ccbluex.liquidbounce.utils.RotationUtils.Companion.targetRotation
import net.ccbluex.liquidbounce.utils.extensions.eyes
import net.ccbluex.liquidbounce.utils.extensions.getDistanceToEntityBox
import net.ccbluex.liquidbounce.utils.extensions.hitBox
import net.ccbluex.liquidbounce.utils.extensions.rayTraceWithServerSideRotation
import net.ccbluex.liquidbounce.utils.misc.RandomUtils
import net.ccbluex.liquidbounce.utils.timer.MSTimer
import net.ccbluex.liquidbounce.utils.timer.TimeUtils
Expand Down Expand Up @@ -396,6 +395,11 @@ object KillAura : Module() {
private val raycastValue = BoolValue("RayCast", true).displayable { bypassDisplay.get() }
private val raycastTargetValue =
BoolValue("RaycastOnlyTarget", false).displayable { raycastValue.get() && raycastValue.displayable }
private val raycastIgnored = BoolValue(
"RayCastIgnored",
false
).displayable { raycastValue.get() && rotationModeValue.get() != "None" }
private val livingRaycast = BoolValue("LivingRayCast", true).displayable { raycastValue.get() && rotationModeValue.get() != "None" }

private val throughWallsValue = BoolValue("ThroughWalls", false)

Expand Down Expand Up @@ -1319,28 +1323,39 @@ object KillAura : Module() {
}

/**
* Check if enemy is hitable with current rotations
* Check if enemy is hittable with current rotations
*/
private fun updateHitable() {
if (currentTarget == null) {
canSwing = false
hitable = false
return
}
var chosenEntity: Entity? = null
val eyes = mc.thePlayer.eyes

val currentRotation = targetRotation ?: mc.thePlayer.rotation
val entityDist = mc.thePlayer.getDistanceToEntityBox(currentTarget as Entity)
canSwing = entityDist < rangeValue.get() && (currentTarget as EntityLivingBase).hurtTime <= hurtTimeValue.get()
if (hitAbleValue.get()) {
hitable = entityDist <= maxRange.toDouble()
val target = this.currentTarget ?: return

if (rotationModeValue.get() == "None") {
hitable = mc.thePlayer.getDistanceToEntityBox(target) <= rangeValue.get()
return
}
// Disable hitable check if turn speed is zero
if (maxTurnSpeedValue.get() <= 0F) {
hitable = true
return

var chosenEntity: Entity? = null

if (raycastValue.get()) {
chosenEntity = raycastEntity(
rangeValue.get().toDouble(),
currentRotation.yaw,
currentRotation.pitch
) { entity -> !livingRaycast.get() || entity is EntityLivingBase && entity !is EntityArmorStand }

if (chosenEntity != null && chosenEntity is EntityLivingBase) {
if (raycastIgnored.get() && target != chosenEntity) {
this.currentTarget = chosenEntity
}
}

hitable = this.currentTarget == chosenEntity
} else {
hitable = RotationUtils.isRotationFaced(target, rangeValue.get().toDouble(), currentRotation)
}

var shouldExcept = false

chosenEntity ?: this.currentTarget?.run {
Expand Down Expand Up @@ -1393,8 +1408,15 @@ object KillAura : Module() {
return
}

val wallTrace = mc.thePlayer.rayTraceWithServerSideRotation(entityDist)
hitable = RotationUtils.isFaced(currentTarget!!, maxRange.toDouble()) && (entityDist < discoverRangeValue.get() || wallTrace?.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) && (currentTarget as EntityLivingBase).hurtTime <= hurtTimeValue.get()
// Recreate raycast logic
val intercept = targetToCheck.hitBox.calculateIntercept(
eyes,
eyes + getVectorForRotation(currentRotation) * rangeValue.get().toDouble()
)

// Is the entity box raycast vector visible? If not, check through-wall range
hitable =
isVisible(intercept.hitVec) || throughWallsValue.get()
}

private fun checkIfAimingAtBox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ object Velocity : Module() {
).displayable { mainMode.get() == "Matrix" }
private val aacMode = ListValue(
"AACMode",
arrayOf("AAC4Reduce", "AAC5Reduce", "AAC5.2.0", "AAC5Vertical", "AAC5.2.0Combat", "AACPush", "AACZero"),
arrayOf("AAC4Reduce", "AAC5Reduce","AAC5.2Reduce", "AAC5.2.0", "AAC5Vertical", "AAC5.2.0Combat", "AACPush", "AACZero"),
"AAC4Reduce"
).displayable { mainMode.get() == "AAC" }
private val reverseMode = ListValue(
Expand All @@ -90,7 +90,7 @@ object Velocity : Module() {
).displayable { mainMode.get() == "Reverse" }
private val otherMode = ListValue(
"OtherMode",
arrayOf("AttackReduce", "IntaveReduce", "Karhu", "Delay", "Phase","KKCraft"),
arrayOf("AttackReduce", "IntaveReduce", "Karhu", "Delay", "Phase"),
"AttackReduce"
).displayable { mainMode.get() == "Other" }

Expand Down Expand Up @@ -343,7 +343,7 @@ object Velocity : Module() {
private var lastAttackTime = 0L
private var intaveDamageTick = 0

//KKCraft
//AAC5.2Reduce
private var lastGround = false

//GrimSimple
Expand Down Expand Up @@ -452,6 +452,11 @@ object Velocity : Module() {
}

"aac5reduce", "aaczero" -> hasReceivedVelocity = true
"aac5.2reduce" -> {
hasReceivedVelocity = true
if (mc.thePlayer.onGround) lastGround = true
if (packet is S12PacketEntityVelocity) motionXZ = getMotionNoXZ(packet)
}
}
}

Expand Down Expand Up @@ -569,12 +574,6 @@ object Velocity : Module() {
}

"intavereduce", "attackreduce" -> hasReceivedVelocity = true

"kkcraft" -> {
hasReceivedVelocity = true
if (mc.thePlayer.onGround) lastGround = true
if (packet is S12PacketEntityVelocity) motionXZ = getMotionNoXZ(packet)
}
"phase" -> {
if (packet is S12PacketEntityVelocity) {
if (!mc.thePlayer.onGround && phaseOnlyGroundValue.get()) {
Expand Down Expand Up @@ -845,6 +844,29 @@ object Velocity : Module() {
fun onAttack(event: AttackEvent) {
val player = mc.thePlayer ?: return
when (mainMode.get().lowercase()) {
"aac" -> when (aacMode.get().lowercase()) {
"aac5.2reduce" -> {
if (player.hurtTime in 2..8) {
if (lastGround) {
player.motionX *= 0.59999999999
player.motionZ *= 0.59999999999
}
}
if (player.hurtTime == 0 && lastGround && player.onGround) {
lastGround = false
}
if (hasReceivedVelocity) {
if (player.hurtTime == 7 && player.onGround) {
if (!mc.gameSettings.keyBindJump.isKeyDown) {
player.jump()
}
player.motionX *= motionXZ
player.motionZ *= motionXZ
}
hasReceivedVelocity = false
}
}
}
"other" -> {
when (otherMode.get().lowercase()) {
"attackreduce" -> {
Expand All @@ -858,28 +880,6 @@ object Velocity : Module() {
}
}

"kkcraft" -> {
if (player.hurtTime in 2..8) {
if (lastGround) {
player.motionX *= 0.59999999999
player.motionZ *= 0.59999999999
}
}
if (player.hurtTime == 0 && lastGround && player.onGround) {
lastGround = false
}
if (hasReceivedVelocity) {
if (player.hurtTime == 7 && player.onGround) {
if (!mc.gameSettings.keyBindJump.isKeyDown) {
player.jump()
}
player.motionX *= motionXZ
player.motionZ *= motionXZ
}
hasReceivedVelocity = false
}
}

"intavereduce" -> {
if (!hasReceivedVelocity) return
if ((hurtTimeMode.get() == "Single" && player.hurtTime == hurtTime.get()) || (hurtTimeMode.get() == "Range" && player.hurtTime in minHurtTime.get()..maxHurtTime.get())) {
Expand Down

This file was deleted.

13 changes: 13 additions & 0 deletions src/main/java/net/ccbluex/liquidbounce/utils/RotationUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,19 @@ class RotationUtils : MinecraftInstance(), Listenable {
return vecRotation
}

/**
* Allows you to check if your crosshair is over your target entity
*
* @param targetEntity your target entity
* @param blockReachDistance your reach
* @return if crosshair is over target
*/
fun isRotationFaced(targetEntity: Entity, blockReachDistance: Double, rotation: Rotation) = raycastEntity(
blockReachDistance,
rotation.yaw,
rotation.pitch
) { entity: Entity -> targetEntity == entity } != null

/**
*
* @param entity
Expand Down

0 comments on commit 44976e0

Please sign in to comment.