From 44976e048358346c15bdbb480ec3c41ebad110e3 Mon Sep 17 00:00:00 2001 From: XeContrast <1683481541@qq.com> Date: Sun, 17 Nov 2024 06:47:53 +0800 Subject: [PATCH] delete TimeBalancer && KKCraft Velocity rename to AAC5.2Reduce --- build.gradle | 2 +- .../module/modules/combat/KillAura.kt | 60 +++++--- .../module/modules/combat/Velocity.kt | 62 ++++---- .../module/modules/movement/TimeBalancer.kt | 140 ------------------ .../liquidbounce/utils/RotationUtils.kt | 13 ++ 5 files changed, 86 insertions(+), 191 deletions(-) delete mode 100644 src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/TimeBalancer.kt diff --git a/build.gradle b/build.gradle index 65cb1dc..8e0e51b 100644 --- a/build.gradle +++ b/build.gradle @@ -132,7 +132,7 @@ processResources { rename "(.+_at.cfg)", "META-INF/\$1" } - +1L task moveResources { doLast { ant.move file: "${buildDir}/resources/main", diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/KillAura.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/KillAura.kt index 549dc36..a63f611 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/KillAura.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/KillAura.kt @@ -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 @@ -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 @@ -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) @@ -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 { @@ -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( diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/Velocity.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/Velocity.kt index 52d2e43..914ff89 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/Velocity.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/Velocity.kt @@ -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( @@ -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" } @@ -343,7 +343,7 @@ object Velocity : Module() { private var lastAttackTime = 0L private var intaveDamageTick = 0 - //KKCraft + //AAC5.2Reduce private var lastGround = false //GrimSimple @@ -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) + } } } @@ -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()) { @@ -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" -> { @@ -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())) { diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/TimeBalancer.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/TimeBalancer.kt deleted file mode 100644 index 8a27230..0000000 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/TimeBalancer.kt +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 类似木糖醇的压缩timer,属于仿制品并且有瑕疵 - * by Pursue(193923709) - * 开源地址:https://github.com/FKtzs/Nattalie - * 群号:673246810 - */ -package net.ccbluex.liquidbounce.features.module.modules.movement - -import net.ccbluex.liquidbounce.event.EventTarget -import net.ccbluex.liquidbounce.event.GameTickEvent -import net.ccbluex.liquidbounce.event.Render2DEvent -import net.ccbluex.liquidbounce.event.UpdateEvent -import net.ccbluex.liquidbounce.features.module.Module -import net.ccbluex.liquidbounce.features.module.ModuleCategory -import net.ccbluex.liquidbounce.features.module.ModuleInfo -import net.ccbluex.liquidbounce.features.value.BoolValue -import net.ccbluex.liquidbounce.features.value.FloatValue -import net.ccbluex.liquidbounce.features.value.IntegerValue -import net.ccbluex.liquidbounce.features.value.ListValue -import net.ccbluex.liquidbounce.ui.font.Fonts -import net.ccbluex.liquidbounce.utils.render.RenderUtils -import net.ccbluex.liquidbounce.utils.render.RoundedUtil -import net.minecraft.client.gui.ScaledResolution -import net.minecraft.client.renderer.GlStateManager -import java.awt.Color - -@ModuleInfo(name = "TimerBalancer", description = "短时间内叠够足够的负数time后立刻释放", category = ModuleCategory.WORLD) -class TimeBalancer : Module() { - - private val timer = FloatValue("TimerSpeed", 4F, 0.1F, 10F) // Timer速度 - private val time = IntegerValue("TimerMaxSet", 5, 0, 30) // 等待积攒时间 - private val tie = IntegerValue("TimerSet", 5, 0, 30) // 释放时间 - - private val counter = BoolValue("Counter",true) // 渲染框架 - private val setaX = ListValue("StartXMode", arrayOf("-","+"), "-") - private val xV = IntegerValue("StartX", 75, 0, 450) - private val setY = ListValue("StartYMode", arrayOf("-","+"), "+") - private val yV = IntegerValue("StartY", 20, 0, 450) - - private val fontR = IntegerValue("FontR", 255, 0, 255) - private val fontG = IntegerValue("FontG", 255, 0, 255) - private val fontB = IntegerValue("FontB", 255, 0, 255) - private val fontA = IntegerValue("FontA", 255, 0, 255) - - private val rectangleR = IntegerValue("RectangleR", 0, 0, 255) - private val rectangleG = IntegerValue("RectangleG", 0, 0, 255) - private val rectangleB = IntegerValue("RectangleB", 0, 0, 255) - private val rectangleA = IntegerValue("RectangleA", 125, 0, 255) - - private val setFrame = ListValue("FrameMode", arrayOf("<","^"), "^") - private val frameR = IntegerValue("FrameR", 0, 0, 255) - private val frameG = IntegerValue("FrameG", 255, 0, 255) - private val frameB = IntegerValue("FrameB", 255, 0, 255) - private val frameA = IntegerValue("FrameA", 255, 0, 255) - - private var lastMS = 0L - private var s = 0 - private var m = 0 - private var timr = false - private var progress = 0f - - - override fun onEnable() { - progress = 0f - } - - override fun onDisable() { - s = 0 - m = 0 - timr = false - mc.timer.timerSpeed = 1F - } - @EventTarget - fun onUpdate(event: UpdateEvent) { - if (timr) { - s++ - } else { - m++ - } - if (m == time.get()) { - timr = true - mc.timer.timerSpeed = timer.get() - m = 0 - s = 0 - } - if (s == tie.get()) { - timr = false - mc.timer.timerSpeed = 1F - m = 0 - s = 0 - } - } - - @EventTarget - fun onTick(event: GameTickEvent?) { - val timer = mc.timer ?: return - try { - val f = timer.javaClass.getDeclaredField("field_74277_g") - f.setAccessible(true) - val t = f[timer] as Long - f[timer] = t + 50L - } catch (e: NoSuchFieldException) { - e.printStackTrace() - } catch (e: IllegalAccessException) { - e.printStackTrace() - } - } - - @EventTarget - fun onRender2D(event: Render2DEvent) { - progress = (System.currentTimeMillis() - lastMS).toFloat() / 100f - if (progress >= 1) progress = 1f - val scaledResolution = ScaledResolution(mc) - val counterMode = counter.get() - val startX = if (setaX.get() == "-") scaledResolution.scaledWidth / 2 - xV.get() else scaledResolution.scaledWidth / 2 + xV.get() - val startY = if (setY.get() == "-") scaledResolution.scaledHeight / 2 - yV.get() else scaledResolution.scaledHeight / 2 + yV.get() - - if (counterMode) { - RenderUtils.drawShadow(startX.toFloat(), startY.toFloat(), 160f, 21f) - GlStateManager.resetColor() - - RoundedUtil.drawRound(startX.toFloat(), startY.toFloat(), 160f, 22f, 3F, Color(rectangleR.get(), rectangleG.get(), rectangleB.get(), rectangleA.get())) - when (setFrame.get().toLowerCase()) { - "^" -> { - RoundedUtil.drawRound(startX.toFloat(), startY.toFloat(), 160f, 3f, 3F, Color(frameR.get(), frameG.get(),frameB.get(), frameA.get())) - GlStateManager.resetColor() - Fonts.font40.drawString("Timer:$m ReleaseTime:$s", (startX - 4 + 36).toFloat(), (startY + 7.5).toFloat(), Color(fontR.get(),fontG.get(),fontB.get(),fontA.get()).rgb) - GlStateManager.resetColor() - } - "<" -> { - RoundedUtil.drawRound(startX.toFloat(), startY.toFloat(), 3f, 22f, 3F, Color(frameR.get(), frameG.get(),frameB.get(), frameA.get())) - GlStateManager.resetColor() - Fonts.font40.drawString("Timer:$m ReleaseTime:$s", (startX - 4 + 36).toFloat(), (startY + 6.5).toFloat(), Color(fontR.get(),fontG.get(),fontB.get(),fontA.get()).rgb) - GlStateManager.resetColor() - } - } - GlStateManager.resetColor() - } - } -} \ No newline at end of file diff --git a/src/main/java/net/ccbluex/liquidbounce/utils/RotationUtils.kt b/src/main/java/net/ccbluex/liquidbounce/utils/RotationUtils.kt index 18413bd..40a4ce4 100644 --- a/src/main/java/net/ccbluex/liquidbounce/utils/RotationUtils.kt +++ b/src/main/java/net/ccbluex/liquidbounce/utils/RotationUtils.kt @@ -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