Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
merge 1d2efa3
Browse files Browse the repository at this point in the history
  • Loading branch information
ManInMyVan committed Jan 26, 2024
1 parent 62f4a71 commit 51559cb
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,58 @@
package net.ccbluex.liquidbounce.features.module.modules.movement

import net.ccbluex.liquidbounce.event.EventTarget
import net.ccbluex.liquidbounce.event.PacketEvent
import net.ccbluex.liquidbounce.event.UpdateEvent
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.features.module.ModuleCategory
import net.minecraft.network.play.client.C03PacketPlayer
import net.minecraft.network.play.server.S08PacketPlayerPosLook

object Freeze : Module("Freeze", ModuleCategory.MOVEMENT) {
private var motionX = 0.0
private var motionY = 0.0
private var motionZ = 0.0
private var x = 0.0
private var y = 0.0
private var z = 0.0

override fun onEnable() {
mc.thePlayer ?: return

x = mc.thePlayer.posX
y = mc.thePlayer.posY
z = mc.thePlayer.posZ
motionX = mc.thePlayer.motionX
motionY = mc.thePlayer.motionY
motionZ = mc.thePlayer.motionZ
}

@EventTarget
fun onUpdate(event: UpdateEvent) {
val thePlayer = mc.thePlayer
mc.thePlayer.motionX = 0.0
mc.thePlayer.motionY = 0.0
mc.thePlayer.motionZ = 0.0
mc.thePlayer.setPositionAndRotation(x, y, z, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch)
}

thePlayer.isDead = true
thePlayer.rotationYaw = thePlayer.cameraYaw
thePlayer.rotationPitch = thePlayer.cameraPitch
@EventTarget
fun onPacket(event: PacketEvent) {
if (event.packet is C03PacketPlayer)
event.cancelEvent()
if (event.packet is S08PacketPlayerPosLook) {
x = event.packet.x
y = event.packet.y
z = event.packet.z
motionX = 0.0
motionY = 0.0
motionZ = 0.0
}
}

override fun onDisable() {
mc.thePlayer?.isDead = false
mc.thePlayer.motionX = motionX
mc.thePlayer.motionY = motionY
mc.thePlayer.motionZ = motionZ
mc.thePlayer.setPositionAndRotation(x, y, z, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
package net.ccbluex.liquidbounce.features.module.modules.movement

import net.ccbluex.liquidbounce.event.EventTarget
import net.ccbluex.liquidbounce.event.PacketEvent
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.features.module.ModuleCategory
import net.ccbluex.liquidbounce.features.module.modules.world.Scaffold
Expand All @@ -16,6 +18,7 @@ import net.ccbluex.liquidbounce.utils.inventory.InventoryUtils.serverOpenInvento
import net.ccbluex.liquidbounce.value.BoolValue
import net.ccbluex.liquidbounce.value.FloatValue
import net.ccbluex.liquidbounce.value.ListValue
import net.minecraft.network.play.client.C0BPacketEntityAction
import net.minecraft.potion.Potion
import net.minecraft.util.MovementInput
import kotlin.math.abs
Expand All @@ -42,6 +45,7 @@ object Sprint : Module("Sprint", ModuleCategory.MOVEMENT, gameDetecting = false)
private val checkServerSide by BoolValue("CheckServerSide", false) { mode == "Vanilla" }
private val checkServerSideGround by BoolValue("CheckServerSideOnlyGround", false)
{ mode == "Vanilla" && checkServerSide }
private val noPackets by BoolValue("NoPackets", false) { mode == "Vanilla" }

private var isSprinting = false

Expand Down Expand Up @@ -143,4 +147,19 @@ object Sprint : Module("Sprint", ModuleCategory.MOVEMENT, gameDetecting = false)

return modifiedForward < threshold
}

@EventTarget
fun onPacket(event: PacketEvent) {
if (mode == "Legit") {
return
}

val packet = event.packet
if (packet !is C0BPacketEntityAction || !noPackets || event.isCancelled) {
return
}
if (packet.action == C0BPacketEntityAction.Action.STOP_SPRINTING || packet.action == C0BPacketEntityAction.Action.START_SPRINTING) {
event.cancelEvent()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object BedProtectionESP : Module("BedProtectionESP", ModuleCategory.RENDER, subj
private val blocksToRender = mutableSetOf<BlockPos>()
private var thread: Thread? = null

private val breakableBlockIDs = arrayOf(35, 159, 121, 20, 5, 49) // wool, stained_clay, end_stone, glass, wood, obsidian
private val breakableBlockIDs = arrayOf(35, 24, 159, 121, 20, 5, 49) // wool, sandstone, stained_clay, end_stone, glass, wood, obsidian

private fun getBlocksToRender(targetBlock: Block, maxLayers: Int, down: Boolean, allLayers: Boolean, blockLimit: Int) {
val targetBlockID = getIdFromBlock(targetBlock)
Expand Down

0 comments on commit 51559cb

Please sign in to comment.