HypixelBunny.kt
/*
* LiquidBounce Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/CCBlueX/LiquidBounce/
*/
package net.ccbluex.liquidbounce.features.module.modules.movement.speeds.other
import net.ccbluex.liquidbounce.event.MoveEvent
import net.ccbluex.liquidbounce.features.module.modules.movement.speeds.SpeedMode
import net.ccbluex.liquidbounce.utils.MovementUtil
import net.ccbluex.liquidbounce.utils.MovementUtils
import net.minecraft.potion.Potion
import kotlin.math.cos
import kotlin.math.sin
import kotlin.math.sqrt
/**
*
* Skid By DeadStar
* @Date on 2023/8/22
*
*/
class HypixelBunny : SpeedMode("HypixelBunny") {
? ?private fun getSpeedPotion(): Int {
? ? ? ?return if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).amplifier + 1 else 0
? ?}
? ?fun getMoveYaw(): Float {
? ? ? ?var moveYaw = mc.thePlayer.rotationYaw
? ? ? ?if (mc.thePlayer.moveForward != 0f && mc.thePlayer.moveStrafing == 0f) {
? ? ? ? ? ?moveYaw += (if (mc.thePlayer.moveForward > 0) 0 else 180).toFloat()
? ? ? ?} else if (mc.thePlayer.moveForward != 0f && mc.thePlayer.moveStrafing != 0f) {
? ? ? ? ? ?if (mc.thePlayer.moveForward > 0) moveYaw += (if (mc.thePlayer.moveStrafing > 0) -45 else 45).toFloat() else moveYaw -= (if (mc.thePlayer.moveStrafing > 0) -45 else 45).toFloat()
? ? ? ? ? ?moveYaw += (if (mc.thePlayer.moveForward > 0) 0 else 180).toFloat()
? ? ? ?} else if (mc.thePlayer.moveStrafing != 0f && mc.thePlayer.moveForward == 0f) {
? ? ? ? ? ?moveYaw += (if (mc.thePlayer.moveStrafing > 0) -90 else 90).toFloat()
? ? ? ?}
? ? ? ?return moveYaw
? ?}
? ? ? private fun setMoveSpeed() {
? ? ? ?var yaw = getMoveYaw();
? ? ? ? ? var speed = MovementUtils.getSpeed()
? ? ? ?if (mc.thePlayer.moveForward != 0.toFloat() || mc.thePlayer.moveStrafing != 0.toFloat()) {
? ? ? ? ? ?mc.thePlayer.motionX = -sin(Math.toRadians(yaw.toDouble())) * speed;
? ? ? ? ? ?mc.thePlayer.motionZ = cos(Math.toRadians(yaw.toDouble())) * speed;
? ? ? ?}
? ?}
? ?override fun onMotion() {
? ?}
? ?override fun onDisable() {
? ?}
? ?override fun onMove(event: MoveEvent?) {}
? ?override fun onUpdate() {
? ? ? ?if (mc.thePlayer.onGround && (mc.thePlayer.moveForward != 0.toFloat() || mc.thePlayer.moveStrafing != 0.toFloat())) {
? ? ? ? ? ?mc.thePlayer.jump();
? ? ? ? ? ?setMoveSpeed()
? ? ? ?}
? ?}
}