Skip to content

Commit

Permalink
IDK
Browse files Browse the repository at this point in the history
  • Loading branch information
XeContrast committed Dec 21, 2024
1 parent d718621 commit 7e67aaa
Show file tree
Hide file tree
Showing 31 changed files with 764 additions and 265 deletions.
34 changes: 17 additions & 17 deletions src/main/java/net/ccbluex/liquidbounce/FDPClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
package net.ccbluex.liquidbounce

import com.google.gson.JsonParser
import net.ccbluex.liquidbounce.event.ClientShutdownEvent
import net.ccbluex.liquidbounce.event.EventManager
import net.ccbluex.liquidbounce.features.command.CommandManager
Expand All @@ -30,13 +29,11 @@ import net.ccbluex.liquidbounce.ui.font.Fonts
import net.ccbluex.liquidbounce.ui.i18n.LanguageManager
import net.ccbluex.liquidbounce.ui.sound.TipSoundManager
import net.ccbluex.liquidbounce.utils.*
import net.ccbluex.liquidbounce.utils.misc.HttpUtils
import net.ccbluex.liquidbounce.utils.timing.WaitTickUtils
import net.ccbluex.liquidbounce.utils.WaitTickUtils
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiScreen
import net.minecraft.util.ResourceLocation
import java.util.*
import kotlin.concurrent.thread

object FDPClient {

Expand Down Expand Up @@ -132,19 +129,22 @@ object FDPClient {
LanguageManager.switchLanguage(Minecraft.getMinecraft().gameSettings.language)

// Register listeners
eventManager.registerListener(RotationUtils())
eventManager.registerListener(ClientFixes)
eventManager.registerListener(InventoryUtils)
eventManager.registerListener(BungeeCordSpoof())
eventManager.registerListener(ServerSpoof)
eventManager.registerListener(WaitTickUtils)
eventManager.registerListener(SessionUtils())
eventManager.registerListener(StatisticsUtils())
eventManager.registerListener(LocationCache())
eventManager.registerListener(PacketUtils)
eventManager.registerListener(MiniMapRegister)
eventManager.registerListener(macroManager)
eventManager.registerListener(combatManager)
eventManager.registerListenerAll(
RotationUtils(),
ClientFixes,
InventoryUtils,
BungeeCordSpoof(),
ServerSpoof,
WaitTickUtils,
SessionUtils(),
StatisticsUtils(),
LocationCache(),
PacketUtils,
MiniMapRegister,
macroManager,
combatManager,
BlinkComponent
)

// Load client fonts
Fonts.loadFonts()
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/ccbluex/liquidbounce/event/EventManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class EventManager : MinecraftInstance() {
}
}

fun registerListenerAll(vararg listener: Listenable) {
listener.forEach { registerListener(it) }
}

/**
* Unregister listener
*
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/net/ccbluex/liquidbounce/event/EventType.kt

This file was deleted.

2 changes: 2 additions & 0 deletions src/main/java/net/ccbluex/liquidbounce/event/Events.kt
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,5 @@ object ClickUpdateEvent : CancellableEvent() {
isCancelled = false
}
}

class MoveMathEvent(var strafe : Float,var forward : Float) : CancellableEvent()
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ 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.script.api.global.Chat
import net.ccbluex.liquidbounce.utils.*
import net.ccbluex.liquidbounce.utils.EntityUtils.isLookingOnEntities
import net.ccbluex.liquidbounce.utils.EntityUtils.isSelected
Expand Down Expand Up @@ -302,6 +303,8 @@ object AntiKB : Module() {
private val ignoreBlocking = BoolValue("IgnoreBlocking", false).displayable { mainMode.get() == "GrimAC" && grimMode.get() == "GrimClick"}
private val clickRange = FloatValue("ClickRange", 3f, 1f,6f).displayable { mainMode.get() == "GrimAC" && grimMode.get() == "GrimClick"}
private val swingMode = ListValue("SwingMode", arrayOf("Off", "Normal", "Packet"), "Normal").displayable { mainMode.get() == "GrimAC" && grimMode.get() == "GrimClick"}

private val debug = BoolValue("Debug",false)

//
private var hasReceivedVelocity = false
Expand Down Expand Up @@ -373,6 +376,11 @@ object AntiKB : Module() {
&& ((thePlayer.motionX + packet.field_149152_f) != 0.0 || (thePlayer.motionZ + packet.field_149159_h) != 0.0))
) {
velocityTimer.reset()

if (debug.get()) {
if (packet is S12PacketEntityVelocity)
Chat.print("§7[§b§lAntiKB§7] X: ${packet.realMotionX},Y: ${packet.realMotionY},Z: ${packet.realMotionZ}")
}
when (mainMode.get().lowercase()) {
"grimac" -> {
when (grimMode.get().lowercase()) {
Expand Down Expand Up @@ -1021,14 +1029,24 @@ object AntiKB : Module() {
val objectMouseOver = mc.objectMouseOver ?: return
if (unReduceTimes > 0 && mc.thePlayer.hurtTime > 0 && (objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && objectMouseOver.entityHit is EntityPlayer) || (KillAura.handleEvents() && KillAura.currentTarget != null)) {
if (!mc.thePlayer.serverSprintState) {
sendPacket(C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.START_SPRINTING))
sendPacket(
C0BPacketEntityAction(
mc.thePlayer,
C0BPacketEntityAction.Action.START_SPRINTING
)
)
mc.thePlayer.serverSprintState = true
mc.thePlayer.isSprinting = true
}

for (i in 0 until reduceCount.get()) {
mc.thePlayer.swingItem()
sendPacket(C02PacketUseEntity(mc.objectMouseOver.entityHit,C02PacketUseEntity.Action.ATTACK))
sendPacket(
C02PacketUseEntity(
mc.objectMouseOver.entityHit,
C02PacketUseEntity.Action.ATTACK
)
)

mc.thePlayer.motionX *= 0.6
mc.thePlayer.motionZ *= 0.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ object AutoRod : Module() {
return -1
}

private fun getAllNearbyEnemies(): List<Entity>? {
fun getAllNearbyEnemies(): List<Entity>? {
val player = mc.thePlayer ?: return null

return mc.theWorld.loadedEntityList.toList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import net.ccbluex.liquidbounce.utils.timer.MSTimer
import net.ccbluex.liquidbounce.features.value.BoolValue
import net.ccbluex.liquidbounce.features.value.IntegerValue
import net.ccbluex.liquidbounce.features.value.ListValue
import net.ccbluex.liquidbounce.script.api.global.Chat
import net.minecraft.entity.EntityLivingBase
import net.minecraft.network.play.client.C03PacketPlayer
import net.minecraft.network.play.server.S08PacketPlayerPosLook
Expand Down Expand Up @@ -143,7 +144,7 @@ object Criticals : Module() {

if (packet is S0BPacketAnimation && debugValue.get()) {
if (packet.animationType == 4 && packet.entityID == target) {
alert("CRIT")
Chat.print("§7[§b§lCriticals§7] CRIT")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ object Reach : Module() {
val buildReachValue = FloatValue("BuildReach", 5f, 4.5f, 7f)

val maxRange: Float

get() = max(combatReachValue.get(), buildReachValue.get())

val hitReach: Float
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ object NoSlow : Module() {
private val consumeModifyValue = BoolValue("Consume", true)
private val consumePacketValue = ListValue(
"ConsumePacket",
arrayOf("None", "AAC5", "SpamItemChange", "SpamPlace", "SpamEmptyPlace","UNCP", "Glitch", "Grim","Bug","Intave","InvalidC08", "Packet"),
arrayOf("None", "AAC5", "SpamItemChange", "SpamPlace", "SpamEmptyPlace","UNCP", "Glitch", "Grim","Bug","Intave","InvalidC08", "Packet").sortedArray(),
"None"
).displayable { consumeModifyValue.get() }
private val consumeTimingValue =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
package net.ccbluex.liquidbounce.features.module.modules.player

import net.ccbluex.liquidbounce.event.*
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.FloatValue
import net.ccbluex.liquidbounce.features.value.ListValue
import net.ccbluex.liquidbounce.ui.client.gui.clickgui.utils.animations.ContinualAnimation
import net.ccbluex.liquidbounce.ui.font.Fonts
import net.ccbluex.liquidbounce.utils.BlinkComponent
import net.ccbluex.liquidbounce.utils.BlinkComponent.dispatch
import net.ccbluex.liquidbounce.utils.BlinkComponent.setExempt
import net.ccbluex.liquidbounce.utils.InventoryUtils.findItem
import net.ccbluex.liquidbounce.utils.PacketUtils.sendPacket
import net.ccbluex.liquidbounce.utils.render.ColorUtils.rainbow
import net.ccbluex.liquidbounce.utils.render.RoundedUtil
import net.ccbluex.liquidbounce.utils.timer.TimerUtils
import net.minecraft.client.gui.ScaledResolution
import net.minecraft.init.Items
import net.minecraft.network.play.client.*
import java.text.DecimalFormat
import kotlin.math.min

@ModuleInfo(name = "AutoGap", category = ModuleCategory.PLAYER)
class AutoGap : Module() {
val mode: ListValue = ListValue("Mode", arrayOf("Dev"), "Dev")
val health: FloatValue = FloatValue("Health", 15f, 1f, 20f)
val delay: FloatValue = FloatValue("Delay", 75f, 0f, 300f)
private val timer = TimerUtils()
@JvmField
var eating: Boolean = false
private var movingPackets = 0
private var slot = 0
val animations = ContinualAnimation()

override fun onEnable() {
movingPackets = 0
slot = -1
eating = false
}

override fun onDisable() {
eating = false
dispatch()
movingPackets = 0
}

@EventTarget
fun onWorld(event: WorldEvent?) {
eating = false
movingPackets = 0
}

@EventTarget
fun onMotion(event: MotionEvent) {
if (mode.get() == "Dev") {
if (event.eventState == EventState.POST && eating) {
movingPackets++
}

if (event.eventState == EventState.PRE) {
if (mc.thePlayer == null || !mc.thePlayer.isEntityAlive) {
eating = false
dispatch()
movingPackets = 0

return
}

if (!mc.playerController.getCurrentGameType().isSurvivalOrAdventure || !timer.hasTimeElapsed(delay.get())) {
eating = false
dispatch()
movingPackets = 0

return
}

slot = findItem(36, 45, Items.golden_apple) - 36
if (slot == -1 || mc.thePlayer.health >= health.get()) {
if (eating) {
eating = false
dispatch()
movingPackets = 0
}
} else {
eating = true
setExempt(
C0EPacketClickWindow::class.java,
C16PacketClientStatus::class.java,
C0DPacketCloseWindow::class.java,
C09PacketHeldItemChange::class.java
)
BlinkComponent.blinking = true
if (movingPackets >= 32) {
sendPacket(C09PacketHeldItemChange(slot), true)
sendPacket(C08PacketPlayerBlockPlacement(mc.thePlayer.heldItem), false)
mc.thePlayer.itemInUseCount -= 32
dispatch()
movingPackets = 0
sendPacket(C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem), false)
timer.reset()
} else if (mc.thePlayer.ticksExisted % 3 == 0) {
while (!BlinkComponent.packets.isEmpty()) {
val packet = BlinkComponent.packets.poll()

if (packet is C03PacketPlayer) {
movingPackets--
}

dispatch()
}
}
}
}
}
}

@EventTarget
fun onMoveMath(event: MoveMathEvent) {
if (eating) event.isCancelled = true
}

@EventTarget
fun onRender2D(event: Render2DEvent?) {
if (mode.get() == "Dev") {
val resolution = ScaledResolution(mc)
val x = resolution.scaledWidth / 2
val y = resolution.scaledHeight - 75
val thickness = 5f

val percentage = (min(movingPackets.toDouble(), 32.0) / 32f).toFloat()

val width = 100
val half = width / 2
animations.animate((width - 2) * percentage, 40)

RoundedUtil.drawRound(
(x - half - 1).toFloat(),
(y - 1 - 12).toFloat(),
(width + 1).toFloat(),
((thickness + 1).toInt() + 12 + 3).toFloat(),
2f,
rainbow()
)
RoundedUtil.drawRound(
(x - half - 1).toFloat(),
(y - 1).toFloat(),
(width + 1).toFloat(),
(thickness + 1).toInt().toFloat(),
2f,
rainbow()
)

RoundedUtil.drawGradientHorizontal(
(x - half).toFloat(),
(y + 1).toFloat(),
animations.output,
thickness,
2f,
rainbow(),
rainbow(90)
)

Fonts.font35.drawCenteredString("Time", x.toFloat(), (y - 1 - 11 + 3).toFloat(), -1)

Fonts.font35.drawCenteredString(
DecimalFormat("0.0").format((percentage * 100).toDouble()) + "%",
x.toFloat(),
(y + 2).toFloat(),
-1
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ object InvManager : Module() {
private val maxblock = IntegerValue("MaxBlock", 128, 0, 2304)
private val maxarrow = IntegerValue("MaxArrow", 128, 0, 2304)
private val maxfood = IntegerValue("MaxFood", 128, 0, 2304)
private val maxRod = IntegerValue("MaxRod", 1,0,36)
private val sortSlot1Value = ListValue("SortSlot-1", items, "Sword").displayable { sortValue.get() }
private val sortSlot2Value = ListValue("SortSlot-2", items, "Gapple").displayable { sortValue.get() }
private val sortSlot3Value = ListValue("SortSlot-3", items, "Potion").displayable { sortValue.get() }
Expand Down Expand Up @@ -396,7 +397,7 @@ object InvManager : Module() {
is ItemBlock -> return !InventoryUtils.isBlockListBlock(item) && amount[1] <= maxblock.get()
is ItemPotion -> return isUsefulPotion(itemStack)
is ItemBoat,is ItemMinecart -> return ignoreVehiclesValue.get()
is ItemFishingRod -> return amount[4] < 1
is ItemFishingRod -> return mc.thePlayer?.openContainer?.inventory?.count { it?.item is ItemFishingRod }!! < maxRod.get()
is ItemBed, is ItemEnderPearl,is ItemBucket -> return true
}

Expand Down Expand Up @@ -672,6 +673,10 @@ object InvManager : Module() {
return intArrayOf(missileAmount, blockAmount, arrowAmount,foodAmount,rod)
}

private fun fishingRod() : Int {
return mc.thePlayer.inventory.mainInventory.count { it.item is ItemFishingRod }
}

/**
* Get type of [targetSlot]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import net.ccbluex.liquidbounce.event.EventTarget
import net.ccbluex.liquidbounce.event.PacketEvent
import net.ccbluex.liquidbounce.features.module.modules.player.nofalls.NoFallMode
import net.ccbluex.liquidbounce.utils.misc.FallingPlayer
import net.ccbluex.liquidbounce.utils.timing.WaitTickUtils
import net.ccbluex.liquidbounce.utils.WaitTickUtils
import net.minecraft.network.play.client.C03PacketPlayer

class HypixelTimerNoFall : NoFallMode("Hypixel") {
Expand Down
Loading

0 comments on commit 7e67aaa

Please sign in to comment.