Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
PrahXZ committed Apr 16, 2024
2 parents c0bac05 + ca97826 commit 7085138
Show file tree
Hide file tree
Showing 53 changed files with 1,090 additions and 757 deletions.
3 changes: 2 additions & 1 deletion src/main/java/net/ccbluex/liquidbounce/event/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ open class CancellableEvent : Event() {
}

enum class EventState(val stateName: String) {
PRE("PRE"), POST("POST")
PRE("PRE"), POST("POST"), // MotionEvent
SEND("SEND"), RECEIVE("RECEIVE") // PacketEvent
}
20 changes: 6 additions & 14 deletions src/main/java/net/ccbluex/liquidbounce/event/Events.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,6 @@ import net.minecraft.util.EnumFacing
*/
class AttackEvent(val targetEntity: Entity) : CancellableEvent()

class FogColorEvent(var red: Float, var green: Float, var blue: Float, var alpha: Int) : Event(){
@JvmName("setRed1")
fun setRed(red: Int) {
this.red = red.toFloat()
}
@JvmName("setGreen1")
fun setGreen(green: Int) {
this.green = green.toFloat()
}
@JvmName("setBlue1")
fun setBlue(blue: Int) {
this.blue = blue.toFloat()
}
}
/**
* Called when player killed other entity
*
Expand Down Expand Up @@ -120,6 +106,12 @@ class UpdateModelEvent(val player: EntityPlayer, val model: ModelPlayer) : Event
*/
class EntityDamageEvent(val damagedEntity: Entity): Event()


/**
* Called after motion
*/
class PostMotionEvent: Event()

/**
* Called in "onLivingUpdate" when the player is using a use item.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ object FakeLag : Module() {
private var hasPlace = false
override fun onDisable() {
releasePackets()
hasPlace = false;
clear();
hasPlace = false
clear()
}

fun fakeLagPacket(event: PacketEvent) {
Expand Down Expand Up @@ -425,4 +425,4 @@ private class PosData {
--increment
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import net.ccbluex.liquidbounce.features.module.modules.visual.FreeCam
import net.ccbluex.liquidbounce.handler.protocol.api.ProtocolFixer
import net.ccbluex.liquidbounce.ui.font.Fonts
import net.ccbluex.liquidbounce.utils.*
import net.ccbluex.liquidbounce.utils.ClientUtils.runTimeTicks
import net.ccbluex.liquidbounce.utils.EntityUtils.isLookingOnEntities
import net.ccbluex.liquidbounce.utils.extensions.getDistanceToEntityBox
import net.ccbluex.liquidbounce.utils.extensions.hitBox
import net.ccbluex.liquidbounce.utils.extensions.rayTraceWithServerSideRotation
Expand Down Expand Up @@ -130,7 +132,10 @@ object KillAura : Module() {
).displayable { modeDisplay.get() }

private val targetModeValue = ListValue("TargetMode", arrayOf("Single", "Switch", "Multi"), "Switch").displayable { modeDisplay.get() }

private val maxSwitchFOV = FloatValue("MaxSwitchFOV", 90f, 30f,180f).displayable { targetModeValue.equals("Switch") && modeDisplay.get() }
private val switchDelayValue = IntegerValue("SwitchDelay", 15, 1, 2000).displayable { targetModeValue.equals("Switch") && modeDisplay.get() }

private val limitedMultiTargetsValue = IntegerValue("LimitedMultiTargets", 0, 0, 50).displayable { targetModeValue.equals("Multi") && modeDisplay.get() }

// AutoBlock
Expand All @@ -152,6 +157,10 @@ object KillAura : Module() {
private val blinkBlockMode = ListValue("BlinkBlockType", arrayOf("Blatant", "Legit3tick", "Legit4tick", "Legit5tick", "Dynamic"), "Legit3tick").displayable { autoBlockPacketValue.displayable && autoBlockPacketValue.equals("Blink") }
private val alwaysBlockDisplayValue = BoolValue("AlwaysRenderBlocking", true).displayable { autoBlockValue.displayable && autoBlockValue.equals("Range") }

// Hit delay
private val useHitDelay = BoolValue("UseHitDelay", false)
private val hitDelayTicks = IntegerValue("HitDelayTicks", 1, 1,5).displayable { useHitDelay.get() }

// Rotations
private val rotationDisplay = BoolValue("Rotation Options:", true)

Expand Down Expand Up @@ -287,6 +296,7 @@ object KillAura : Module() {
private val rotationTimer = MSTimer()
private var attackDelay = 0L
private var clicks = 0
private var attackTickTimes = mutableListOf<Pair<MovingObjectPosition, Int>>()

// Container Delay
private var containerOpen = -1L
Expand Down Expand Up @@ -363,6 +373,7 @@ object KillAura : Module() {
discoveredTargets.clear()
inRangeDiscoveredTargets.clear()
attackTimer.reset()
attackTickTimes.clear()
clicks = 0
canSwing = false

Expand Down Expand Up @@ -445,6 +456,11 @@ object KillAura : Module() {

}

@EventTarget
fun onWorldChange(event: WorldEvent) {
attackTickTimes.clear()
}

/**
* Update event
*/
Expand Down Expand Up @@ -780,7 +796,8 @@ object KillAura : Module() {
val entityFov = RotationUtils.getRotationDifference(entity)

if (distance <= discoverRangeValue.get() && (fov == 180F || entityFov <= fov)) {
discoveredTargets.add(entity)
if (switchMode && isLookingOnEntities(entity, maxSwitchFOV.get().toDouble()) || !switchMode)
discoveredTargets.add(entity)
}
}

Expand Down Expand Up @@ -1212,6 +1229,24 @@ object KillAura : Module() {
return TimeUtils.randomClickDelay(minCps.coerceAtMost(maxCps), minCps.coerceAtLeast(maxCps))
}

/**
* Check if raycast landed on a different object
*
* The game requires at least 1 tick of cooldown on raycast object type change (miss, block, entity)
* We are doing the same thing here but allow more cool down.
*/

// no finished
private fun shouldDelayClick(type: MovingObjectPosition.MovingObjectType): Boolean {
if (!useHitDelay.get()) {
return false
}

val lastAttack = attackTickTimes.lastOrNull()

return lastAttack != null && lastAttack.first.typeOfHit != type && runTimeTicks - lastAttack.second <= hitDelayTicks.get()
}

/**
* Check if run should be cancelled
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* FDPClient Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.matrix

import net.ccbluex.liquidbounce.FDPClient
import net.ccbluex.liquidbounce.event.PacketEvent
import net.ccbluex.liquidbounce.event.PostMotionEvent
import net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.DisablerMode
import net.ccbluex.liquidbounce.features.module.modules.movement.Flight
import net.ccbluex.liquidbounce.features.module.modules.movement.Speed
import net.ccbluex.liquidbounce.utils.ClientUtils.displayChatMessage
import net.ccbluex.liquidbounce.utils.MovementUtils.isMoving
import net.ccbluex.liquidbounce.utils.PacketUtils
import net.ccbluex.liquidbounce.utils.RotationUtils
import net.ccbluex.liquidbounce.value.BoolValue
import net.minecraft.network.play.client.C03PacketPlayer
import net.minecraft.network.play.client.C09PacketHeldItemChange
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement
import net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook
import net.minecraft.util.BlockPos

class MatrixDisabler : DisablerMode("Matrix") {

private val matrixNoCheck = BoolValue("NoModuleCheck", false)
private val matrixMoveFix = BoolValue("MoveFix", true)
private val matrixMoveOnly = BoolValue("MoveOnly", false)
private val matrixNoMovePacket = BoolValue("NoMovePacket", true)
private val matrixHotbarChange = BoolValue("HotbarChange", true)

override fun onPacket(event: PacketEvent) {
val packet = event.packet
if (matrixNoCheck.get() || FDPClient.moduleManager.getModule(Speed::class.java)!!.state || FDPClient.moduleManager.getModule(Flight::class.java)!!.state) {
if (packet is C03PacketPlayer) {
if (matrixNoMovePacket.get() && !packet.isMoving) {
event.cancelEvent()
displayChatMessage("no move, cancelled")
return
}
if (matrixMoveFix.get()) {
packet.onGround = true
if (!packet.rotating) {
packet.rotating = true
packet.yaw = mc.thePlayer.rotationYaw
packet.pitch = mc.thePlayer.rotationPitch
}
}
}
}
}

@Override
fun onPostMotion(event: PostMotionEvent) {
if (!matrixMoveOnly.get() || isMoving())
if (matrixNoCheck.get() || FDPClient.moduleManager[Flight::class.java]!!.state || FDPClient.moduleManager[Speed::class.java]!!.state) {
var changed = false
if (matrixHotbarChange.get()) for (i in 0..8) {
// find an empty inventory slot
if(mc.thePlayer.inventory.mainInventory[i] == null && i != mc.thePlayer.inventory.currentItem) {
PacketUtils.sendPacketNoEvent(C09PacketHeldItemChange(i))
changed = true
displayChatMessage("found empty slot $i, switching")
break
}
}

RotationUtils.serverRotation?.let { C06PacketPlayerPosLook(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, it.yaw, RotationUtils.serverRotation!!.pitch, mc.thePlayer.onGround) }
?.let { PacketUtils.sendPacketNoEvent(it) }
mc.netHandler.addToSendQueue(C08PacketPlayerBlockPlacement(BlockPos(-1, -1, -1), -1, null, 0f, 0f, 0f))
displayChatMessage("sent placement")

if (changed) {
PacketUtils.sendPacketNoEvent(C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem))
displayChatMessage("switched back")
}
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* FDPClient Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.other

import net.ccbluex.liquidbounce.event.PacketEvent
import net.ccbluex.liquidbounce.event.Render2DEvent
import net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.DisablerMode
import net.ccbluex.liquidbounce.utils.ClientUtils
import net.ccbluex.liquidbounce.utils.PacketUtils
import net.ccbluex.liquidbounce.utils.Rotation
import net.ccbluex.liquidbounce.utils.timer.MSTimer
import net.ccbluex.liquidbounce.value.IntegerValue
import net.minecraft.network.play.client.C0FPacketConfirmTransaction
import net.minecraft.network.play.server.S08PacketPlayerPosLook
import net.minecraft.network.play.server.S32PacketConfirmTransaction
import net.minecraft.network.play.INetHandlerPlayServer
import net.minecraft.network.Packet

/**
* A disabler that delay transaction on some anticheat like Grim (<=2.3.59) and old Intave
* @author Fyxar
*/
class DelayedTranscation : DisablerMode("DelayedTranscation") {
private val holdSeconds = IntegerValue("HoldSeconds", 20, 1, 50)
private val timer = MSTimer()

private var delay = false
private var lastRotation = Rotation(0f, 0f)

private val packets = mutableListOf<Packet<INetHandlerPlayServer>>()

override fun onEnable() {
timer.reset()
}

override fun onDisable() {
mc.timer.timerSpeed = 1F

if (mc.thePlayer != null)
packets.forEach { PacketUtils.sendPacketNoEvent(it)}

packets.clear()
delay = false
}

fun onRender2D(event: Render2DEvent) {
if (delay) {
val seconds = timer.reachedTime / 1000L
ClientUtils.displayChatMessage("Anticheat will be back after ${holdSeconds.get() - seconds} seconds")
}
}

override fun onPacket(event: PacketEvent) {
if (mc.thePlayer == null || mc.thePlayer.ticksExisted < 20) {
packets.clear()
return
}

val packet = event.packet

if (packet is S08PacketPlayerPosLook) {
if (mc.thePlayer.capabilities.isFlying || mc.thePlayer.capabilities.allowFlying) {
if (!delay) {
timer.reset()
delay = true
}
}
}

if (delay) {
if (timer.hasTimePassed(holdSeconds.get() * 1000L)) {
packets.forEach {PacketUtils.sendPacketNoEvent(it)}
delay = false
packets.clear()
timer.reset()
}

if (packet is S32PacketConfirmTransaction) {
packets.add(packet as Packet<INetHandlerPlayServer>)
event.cancelEvent()

PacketUtils.sendPacketNoEvent(C0FPacketConfirmTransaction())
}
}

}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* FDPClient Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.other

import net.ccbluex.liquidbounce.FDPClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* FDPClient Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.vulcan

import net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.DisablerMode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* FDPClient Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.vulcan

import net.ccbluex.liquidbounce.event.PacketEvent
Expand All @@ -22,9 +27,9 @@ class VulcanCombatDisabler : DisablerMode("VulcanCombat") {
private val minBuffValue = IntegerValue("VulcanMinBuff", 5, 0, 12)
private val noC0BValue = BoolValue("NoC0BPacket", false)
private var currentTrans = 0

//已经死了一半的 Disabler,稍微复活一下。已经无法(只靠这个 Disabler)绕过的 Bypass:Vanilla Velocity / None Rotation

private var currentDelay = 5000
private var currentBuffer = 4
private var currentDec = -1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* FDPClient Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.vulcan

import net.ccbluex.liquidbounce.event.UpdateEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* FDPClient Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.features.module.modules.exploit.disablers.vulcan

import net.ccbluex.liquidbounce.event.PacketEvent
Expand Down
Loading

0 comments on commit 7085138

Please sign in to comment.