diff --git a/build.gradle b/build.gradle index 8e0e51b..65cb1dc 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/Velocity.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/Velocity.kt index 914ff89..62c654e 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 @@ -45,7 +45,7 @@ import kotlin.math.abs import kotlin.math.atan2 import kotlin.math.floor import kotlin.math.sqrt -// + @ModuleInfo(name = "Velocity", category = ModuleCategory.COMBAT) object Velocity : Module() { private val mainMode = @@ -924,7 +924,8 @@ object Velocity : Module() { "grimac" -> { when (grimMode.get().lowercase()) { "grimreduce" -> { - if (unReduceTimes > 0 && mc.thePlayer.hurtTime > 0 && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mc.objectMouseOver.entityHit is EntityPlayer) { + val objectMouseOver = mc.objectMouseOver ?: return + if (unReduceTimes > 0 && mc.thePlayer.hurtTime > 0 && objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && objectMouseOver.entityHit is EntityPlayer) { if (!mc.thePlayer.serverSprintState) { PacketUtils.sendPacket(C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.START_SPRINTING)) mc.thePlayer.serverSprintState = true @@ -932,10 +933,8 @@ object Velocity : Module() { } for (i in 0 until reduceCount.get()) { - PacketUtils.sendPackets( - C0APacketAnimation(), - C02PacketUseEntity(mc.objectMouseOver.entityHit,C02PacketUseEntity.Action.ATTACK) - ) + mc.thePlayer.swingItem() + PacketUtils.sendPacket(C02PacketUseEntity(mc.objectMouseOver.entityHit,C02PacketUseEntity.Action.ATTACK)) mc.thePlayer.motionX *= 0.6 mc.thePlayer.motionZ *= 0.6 diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/exploit/ViaVersionFix.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/exploit/ViaVersionFix.kt index 22de902..6da78b2 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/exploit/ViaVersionFix.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/exploit/ViaVersionFix.kt @@ -5,24 +5,9 @@ */ package net.ccbluex.liquidbounce.features.module.modules.exploit -import net.ccbluex.liquidbounce.FDPClient 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.ui.client.hud.element.elements.Notification -import net.ccbluex.liquidbounce.ui.client.hud.element.elements.NotifyType @ModuleInfo(name = "ViaVersionFix", category = ModuleCategory.EXPLOIT) -class ViaVersionFix : Module() { - override fun onEnable() { - FDPClient.hud.addNotification( - Notification( - "WARNING", - "If you using this module in a low version server < 1.12.Server AntiCheat will detect this as a hack when you right click!", - NotifyType.WARNING, - 4000, - 500 - ) - ) - } -} \ No newline at end of file +class ViaVersionFix : Module() \ No newline at end of file diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/NoSlow.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/NoSlow.kt index 98d9840..dec9124 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/NoSlow.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/NoSlow.kt @@ -146,6 +146,10 @@ object NoSlow : Module() { private var start = false private var stop = false private var mstimer2 = MSTimer() + + private var shouldNoSlow = false + + private var hasDropped = false //hypixel private var postPlace = false //UNCP @@ -254,23 +258,6 @@ object NoSlow : Module() { } } - "bug" -> { - if (mc.thePlayer.heldItem.item is ItemPotion || mc.thePlayer.heldItem.item is ItemBucketMilk || mc.thePlayer.heldItem.stackSize <= 1) { - return - } - mc.thePlayer.sendQueue.addToSendQueue( - C07PacketPlayerDigging( - C07PacketPlayerDigging.Action.DROP_ITEM, - BlockPos(0, 0, 0), - EnumFacing.DOWN - ) - ) - - mc.gameSettings.keyBindUseItem.pressed = false - mc.thePlayer.stopUsingItem() - mstimer2.reset() - } - "spamitemchange" -> { mc.netHandler.addToSendQueue(C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)) } @@ -554,8 +541,10 @@ object NoSlow : Module() { return val heldItem = mc.thePlayer.heldItem?.item - event.forward = getMultiplier(heldItem, true) - event.strafe = getMultiplier(heldItem, false) + if (!consumePacketValue.equals("Bug") || shouldNoSlow) { + event.forward = getMultiplier(heldItem, true) + event.strafe = getMultiplier(heldItem, false) + } } private fun getMultiplier(item: Item?, isForward: Boolean) = when (item) { @@ -655,8 +644,37 @@ object NoSlow : Module() { fun onPacket(event: PacketEvent) { if (mc.thePlayer == null || mc.theWorld == null || (onlyGround.get() && !mc.thePlayer.onGround)) return + val packet = event.packet - val heldItem = mc.thePlayer.heldItem?.item + val heldItem = mc.thePlayer.heldItem.item ?: return + + if (consumePacketValue.equals("Bug")) { + if (mc.thePlayer.heldItem?.item !is ItemFood) return + + val isUsingItem = packet is C08PacketPlayerBlockPlacement && packet.placedBlockDirection == 255 + + if (!mc.thePlayer.isUsingItem) { + shouldNoSlow = false + hasDropped = false + } + + if (isUsingItem && !hasDropped) { + PacketUtils.sendPacket(C07PacketPlayerDigging(C07PacketPlayerDigging.Action.DROP_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)) + shouldNoSlow = false + hasDropped = true + } else if (packet is S2FPacketSetSlot && mc.thePlayer.isUsingItem) { + if (packet.func_149175_c() != 0) return + + event.cancelEvent() + shouldNoSlow = true + + mc.thePlayer.itemInUse = packet.func_149174_e() + if (!mc.thePlayer.isUsingItem) mc.thePlayer.itemInUseCount = 0 + } + mc.thePlayer.stopUsingItem() + mc.gameSettings.keyBindUseItem.pressed = false + + } stop = packet is C07PacketPlayerDigging && packet.status == (C07PacketPlayerDigging.Action.RELEASE_USE_ITEM) if (consumeModifyValue.get() && mc.thePlayer.isUsingItem && (heldItem is ItemFood || heldItem is ItemPotion || heldItem is ItemBucketMilk)) { @@ -710,6 +728,7 @@ object NoSlow : Module() { } } + if ((modeValue.equals("Matrix") || modeValue.equals("GrimAC")) && nextTemp) { if ((packet is C07PacketPlayerDigging || packet is C08PacketPlayerBlockPlacement) && isBlocking) { event.cancelEvent() diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/other/AntiBot.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/other/AntiBot.kt index fd6b14a..ba72f5a 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/other/AntiBot.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/other/AntiBot.kt @@ -17,6 +17,7 @@ import net.ccbluex.liquidbounce.script.api.global.Chat import net.ccbluex.liquidbounce.ui.client.gui.clickgui.fonts.impl.Fonts import net.ccbluex.liquidbounce.ui.client.hud.element.elements.Notification import net.ccbluex.liquidbounce.ui.client.hud.element.elements.NotifyType +import net.ccbluex.liquidbounce.utils.PlayerUtils.getPing import net.ccbluex.liquidbounce.utils.RotationUtils import net.ccbluex.liquidbounce.utils.isMoving import net.ccbluex.liquidbounce.utils.render.ColorUtils.stripColor @@ -39,77 +40,106 @@ object AntiBot : Module() { private val removeFromWorld = BoolValue("RemoveFromWord", false) private val debugValue = BoolValue("Debug", true) - private val kkBot = BoolValue("KKBot",false) - private val tabValue = BoolValue("Tab", true).displayable { modeValue.get() == "Custom"} - private val tabModeValue = ListValue("TabMode", arrayOf("Equals", "Contains"), "Contains").displayable { modeValue.get() == "Custom"} - private val entityIDValue = BoolValue("EntityID", true).displayable { modeValue.get() == "Custom"} - private val colorValue = BoolValue("Color", false).displayable { modeValue.get() == "Custom"} - private val livingTimeValue = BoolValue("LivingTime", false).displayable { modeValue.get() == "Custom"} - private val livingTimeTicksValue = IntegerValue("LivingTimeTicks", 40, 1, 200).displayable { modeValue.get() == "Custom"} - private val groundValue = BoolValue("Ground", true).displayable { modeValue.get() == "Custom"} - private val airValue = BoolValue("Air", false).displayable { modeValue.get() == "Custom"} - private val invalidGroundValue = BoolValue("InvalidGround", true).displayable { modeValue.get() == "Custom"} - private val invalidSpeedValue = BoolValue("InvalidSpeed", true).displayable { modeValue.get() == "Custom"} - private val properties = BoolValue("Properties", false).displayable { modeValue.get() == "Custom"} - private val swingValue = BoolValue("Swing", false).displayable { modeValue.get() == "Custom"} - private val healthValue = BoolValue("Health", false).displayable { modeValue.get() == "Custom"} - private val derpValue = BoolValue("Derp", true).displayable { modeValue.get() == "Custom"} - private val wasInvisibleValue = BoolValue("WasInvisible", false).displayable { modeValue.get() == "Custom"} - private val validNameValue = BoolValue("ValidName", true).displayable { modeValue.get() == "Custom"} - private val armorValue = BoolValue("Armor", false).displayable { modeValue.get() == "Custom"} - private val pingValue = BoolValue("Ping", false).displayable { modeValue.get() == "Custom"} - private val needHitValue = BoolValue("NeedHit", false).displayable { modeValue.get() == "Custom"} - private val noClipValue = BoolValue("NoClip", false).displayable { modeValue.get() == "Custom"} - private val matrix7 = BoolValue("Matrix7", false).displayable { modeValue.get() == "Custom"} - private val czechHekValue = BoolValue("CzechMatrix", false).displayable { modeValue.get() == "Custom"} - private val czechHekPingCheckValue = BoolValue("PingCheck", true).displayable { modeValue.get() == "Custom" && czechHekValue.get()} - private val czechHekGMCheckValue = BoolValue("GamemodeCheck", true).displayable { modeValue.get() == "Custom" && czechHekValue.get()} - private val reusedEntityIdValue = BoolValue("ReusedEntityId", false).displayable { modeValue.get() == "Custom"} - private val spawnInCombatValue = BoolValue("SpawnInCombat", false).displayable { modeValue.get() == "Custom"} - private val skinValue = BoolValue("SkinCheck", false).displayable { modeValue.get() == "Custom"} - private val duplicateInWorldValue = BoolValue("DuplicateInWorld", false).displayable { modeValue.get() == "Custom"} - private val duplicateInTabValue = BoolValue("DuplicateInTab", false).displayable { modeValue.get() == "Custom"} - private val duplicateCompareModeValue = ListValue("DuplicateCompareMode", arrayOf("OnTime", "WhenSpawn"), "OnTime").displayable { modeValue.get() == "Custom"} - private val fastDamageValue = BoolValue("FastDamage", false).displayable { modeValue.get() == "Custom"} - private val fastDamageTicksValue = IntegerValue("FastDamageTicks", 5, 1, 20).displayable { modeValue.get() == "Custom" && fastDamageValue.get()} - private val alwaysInRadiusValue = BoolValue("AlwaysInRadius", false).displayable { modeValue.get() == "Custom"} - private val alwaysRadiusValue = FloatValue("AlwaysInRadiusBlocks", 20f, 5f, 30f).displayable { modeValue.get() == "Custom"} - private val alwaysInRadiusRemoveValue = BoolValue("AlwaysInRadiusRemove", false).displayable { modeValue.get() == "Custom"} - private val alwaysInRadiusWithTicksCheckValue = BoolValue("AlwaysInRadiusWithTicksCheck", false).displayable { modeValue.get() == "Custom"} + private val kkBot = BoolValue("KKBot", false) + private val tabValue = BoolValue("Tab", true).displayable { modeValue.get() == "Custom" } + private val tabModeValue = + ListValue("TabMode", arrayOf("Equals", "Contains"), "Contains").displayable { modeValue.get() == "Custom" } + private val entityIDValue = BoolValue("EntityID", true).displayable { modeValue.get() == "Custom" } + private val colorValue = BoolValue("Color", false).displayable { modeValue.get() == "Custom" } + private val livingTimeValue = BoolValue("LivingTime", false).displayable { modeValue.get() == "Custom" } + private val livingTimeTicksValue = + IntegerValue("LivingTimeTicks", 40, 1, 200).displayable { modeValue.get() == "Custom" } + private val groundValue = BoolValue("Ground", true).displayable { modeValue.get() == "Custom" } + private val airValue = BoolValue("Air", false).displayable { modeValue.get() == "Custom" } + private val invalidGroundValue = BoolValue("InvalidGround", true).displayable { modeValue.get() == "Custom" } + private val invalidSpeedValue = BoolValue("InvalidSpeed", true).displayable { modeValue.get() == "Custom" } + private val properties = BoolValue("Properties", false).displayable { modeValue.get() == "Custom" } + private val swingValue = BoolValue("Swing", false).displayable { modeValue.get() == "Custom" } + private val healthValue = BoolValue("Health", false).displayable { modeValue.get() == "Custom" } + private val derpValue = BoolValue("Derp", true).displayable { modeValue.get() == "Custom" } + private val wasInvisibleValue = BoolValue("WasInvisible", false).displayable { modeValue.get() == "Custom" } + private val validNameValue = BoolValue("ValidName", true).displayable { modeValue.get() == "Custom" } + private val armorValue = BoolValue("Armor", false).displayable { modeValue.get() == "Custom" } + private val pingValue = BoolValue("Ping", false).displayable { modeValue.get() == "Custom" } + private val needHitValue = BoolValue("NeedHit", false).displayable { modeValue.get() == "Custom" } + private val noClipValue = BoolValue("NoClip", false).displayable { modeValue.get() == "Custom" } + private val matrix7 = BoolValue("Matrix7", false).displayable { modeValue.get() == "Custom" } + private val czechHekValue = BoolValue("CzechMatrix", false).displayable { modeValue.get() == "Custom" } + private val czechHekPingCheckValue = + BoolValue("PingCheck", true).displayable { modeValue.get() == "Custom" && czechHekValue.get() } + private val czechHekGMCheckValue = + BoolValue("GamemodeCheck", true).displayable { modeValue.get() == "Custom" && czechHekValue.get() } + private val reusedEntityIdValue = BoolValue("ReusedEntityId", false).displayable { modeValue.get() == "Custom" } + private val spawnInCombatValue = BoolValue("SpawnInCombat", false).displayable { modeValue.get() == "Custom" } + private val skinValue = BoolValue("SkinCheck", false).displayable { modeValue.get() == "Custom" } + private val duplicateInWorldValue = BoolValue("DuplicateInWorld", false).displayable { modeValue.get() == "Custom" } + private val duplicateInTabValue = BoolValue("DuplicateInTab", false).displayable { modeValue.get() == "Custom" } + private val duplicateCompareModeValue = ListValue( + "DuplicateCompareMode", + arrayOf("OnTime", "WhenSpawn"), + "OnTime" + ).displayable { modeValue.get() == "Custom" } + private val fastDamageValue = BoolValue("FastDamage", false).displayable { modeValue.get() == "Custom" } + private val fastDamageTicksValue = + IntegerValue("FastDamageTicks", 5, 1, 20).displayable { modeValue.get() == "Custom" && fastDamageValue.get() } + private val alwaysInRadiusValue = BoolValue("AlwaysInRadius", false).displayable { modeValue.get() == "Custom" } + private val alwaysRadiusValue = + FloatValue("AlwaysInRadiusBlocks", 20f, 5f, 30f).displayable { modeValue.get() == "Custom" } + private val alwaysInRadiusRemoveValue = + BoolValue("AlwaysInRadiusRemove", false).displayable { modeValue.get() == "Custom" } + private val alwaysInRadiusWithTicksCheckValue = + BoolValue("AlwaysInRadiusWithTicksCheck", false).displayable { modeValue.get() == "Custom" } //Helmet - private val allowDiamondHelmet = BoolValue("AllowDiamondHelmet", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowGoldenHelmet = BoolValue("AllowGoldenHelmet", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowIronHelmet = BoolValue("AllowIronHelmet", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowChainHelmet = BoolValue("AllowChainHelmet", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowLeatherHelmet = BoolValue("AllowLeatherHelmet", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowNoHelmet = BoolValue("AllowNoHelmet", true).displayable { modeValue.get() == "UnusualArmor"} + private val allowDiamondHelmet = + BoolValue("AllowDiamondHelmet", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowGoldenHelmet = + BoolValue("AllowGoldenHelmet", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowIronHelmet = BoolValue("AllowIronHelmet", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowChainHelmet = BoolValue("AllowChainHelmet", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowLeatherHelmet = + BoolValue("AllowLeatherHelmet", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowNoHelmet = BoolValue("AllowNoHelmet", true).displayable { modeValue.get() == "UnusualArmor" } //Chestplate - private val allowDiamondChestplate = BoolValue("AllowDiamondChestplate", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowGoldenChestplate = BoolValue("AllowGoldenChestplate", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowIronChestplate = BoolValue("AllowIronChestplate", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowChainChestplate = BoolValue("AllowChainChestplate", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowLeatherChestplate = BoolValue("AllowLeatherChestplate", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowNoChestplate = BoolValue("AllowNoChestplate", true).displayable { modeValue.get() == "UnusualArmor"} + private val allowDiamondChestplate = + BoolValue("AllowDiamondChestplate", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowGoldenChestplate = + BoolValue("AllowGoldenChestplate", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowIronChestplate = + BoolValue("AllowIronChestplate", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowChainChestplate = + BoolValue("AllowChainChestplate", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowLeatherChestplate = + BoolValue("AllowLeatherChestplate", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowNoChestplate = + BoolValue("AllowNoChestplate", true).displayable { modeValue.get() == "UnusualArmor" } //Leggings - private val allowDiamondLeggings = BoolValue("AllowDiamondLeggings", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowGoldenLeggings = BoolValue("AllowGoldenLeggings", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowIronLeggings = BoolValue("AllowIronLeggings", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowChainLeggings = BoolValue("AllowChainLeggings", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowLeatherLeggings = BoolValue("AllowLeatherLeggings", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowNoLeggings = BoolValue("AllowNoLeggings", true).displayable { modeValue.get() == "UnusualArmor"} + private val allowDiamondLeggings = + BoolValue("AllowDiamondLeggings", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowGoldenLeggings = + BoolValue("AllowGoldenLeggings", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowIronLeggings = + BoolValue("AllowIronLeggings", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowChainLeggings = + BoolValue("AllowChainLeggings", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowLeatherLeggings = + BoolValue("AllowLeatherLeggings", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowNoLeggings = BoolValue("AllowNoLeggings", true).displayable { modeValue.get() == "UnusualArmor" } //Boots - private val allowDiamondBoots = BoolValue("AllowDiamondBoots", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowGoldenBoots = BoolValue("AllowGoldenBoots", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowIronBoots = BoolValue("AllowIronBoots", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowChainBoots = BoolValue("AllowChainBoots", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowLeatherBoots = BoolValue("AllowLeatherBoots", true).displayable { modeValue.get() == "UnusualArmor"} - private val allowNoBoots = BoolValue("AllowNoBoots", true).displayable { modeValue.get() == "UnusualArmor"} - - private val removeNoColorLeatherArmor = BoolValue("NoColorLeatherArmor", true).displayable { modeValue.get() == "UnusualArmor"} + private val allowDiamondBoots = + BoolValue("AllowDiamondBoots", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowGoldenBoots = BoolValue("AllowGoldenBoots", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowIronBoots = BoolValue("AllowIronBoots", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowChainBoots = BoolValue("AllowChainBoots", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowLeatherBoots = + BoolValue("AllowLeatherBoots", true).displayable { modeValue.get() == "UnusualArmor" } + private val allowNoBoots = BoolValue("AllowNoBoots", true).displayable { modeValue.get() == "UnusualArmor" } + + private val removeNoColorLeatherArmor = + BoolValue("NoColorLeatherArmor", true).displayable { modeValue.get() == "UnusualArmor" } private val botList = CopyOnWriteArrayList() @@ -359,9 +389,9 @@ object AntiBot : Module() { return true } -// if (matrix7.get() && matrix.contains(entity.entityId)) { -// return true -// } + if (matrix7.get() && matrix.contains(entity.entityId)) { + return true + } if (duplicateCompareModeValue.equals("WhenSpawn") && duplicate.contains(entity.gameProfile.id)) { return true @@ -481,8 +511,8 @@ object AntiBot : Module() { if (speed in 0.45..0.46 && (!entity.isSprinting || !entity.isMoving || - entity.getActivePotionEffect(Potion.moveSpeed) == null)) - { + entity.getActivePotionEffect(Potion.moveSpeed) == null) + ) { invalidSpeedList += entity.entityId } } @@ -562,59 +592,48 @@ object AntiBot : Module() { } if (matrix7.get() && modeValue.get() == "Custom") { - val world = mc.theWorld ?: return +// val world = mc.theWorld ?: return +// val player = mc.thePlayer ?: return +// world.playerEntities.forEach { entity -> +// if (entity != player && entity.customNameTag == "") { +// world.removeEntity(entity) +// if (debugValue.get()) Chat.alert("AntiBot Remove ${entity.gameProfile.name}") +// } val player = mc.thePlayer ?: return - world.playerEntities.forEach { entity -> - if (entity != player && entity.customNameTag == "") { - world.removeEntity(entity) - if (debugValue.get()) Chat.alert("AntiBot Remove ${entity.gameProfile.name}") + val world = mc.theWorld ?: return + mc.theWorld.playerEntities.forEach { entity -> + if (entity.inventory.armorInventory.all { it != null } && entity.heldItem != null) { + val playerPosY = player.posY - 2..player.posY + 2 + + if (entity.posY in playerPosY) { + + val entityRot = entity.rotationYaw + val playerPreRot = player.prevRotationYaw + + val rotDiff = abs(entityRot - playerPreRot) + val utilDiff = abs(entityRot - RotationUtils.serverRotation?.yaw!!) + + if ((rotDiff <= 10 || utilDiff <= 10) && !matrix.contains(entity.entityId)) { +// if (debugValue.get()) Chat.alert("§7[§a§lAnti Bot/§6Matrix§7] §fPrevented §r${entity.gameProfile.name} §ffrom spawning.") +// world.removeEntityFromWorld(entity.entityId) + matrix.add(entity.entityId) + if (debugValue.get()) Chat.alert("AntiBot + ${entity.gameProfile.name}") + } + + if (entity.isSprinting && entity.moveForward == 0f && !matrix.contains(entity.entityId)) { +// if (debugValue.get()) Chat.alert("§7[§a§lAnti Bot/§6Matrix§7] §fPrevented §r${entity.gameProfile.name} §ffrom spawning.") +// world.removeEntityFromWorld(entity.entityId) + matrix.add(entity.entityId) + if (debugValue.get()) Chat.alert("AntiBot + ${entity.gameProfile.name}") + } + if (matrix.contains(entity.entityId)) { + if (packet is S38PacketPlayerListItem && packet.action == S38PacketPlayerListItem.Action.REMOVE_PLAYER) { + if (player.getDistanceToEntity(entity) < 10) matrix.remove(entity.entityId) + } + } + } } } -// val player = mc.thePlayer ?: return -// val world = mc.theWorld ?: return -// for (entity in world.playerEntities) { -// val profile = entity.gameProfile ?: continue -// -// if (entity.getPing() < 2 || profile.properties?.isEmpty == false) { -// continue -// } -// } -// mc.theWorld.playerEntities.forEach { entity -> -// if (entity.inventory.armorInventory.all { it != null } && entity.heldItem != null) { -// -// val player = mc.thePlayer ?: return@forEach -// val world = mc.theWorld ?: return@forEach -// val playerPosY = player.posY - 2..player.posY + 2 -// -// if (entity.posY in playerPosY) { -// -// val entityRot = entity.rotationYaw -// val playerPreRot = player.prevRotationYaw -// -// val rotDiff = abs(entityRot - playerPreRot) -// val utilDiff = abs(entityRot - RotationUtils.serverRotation?.yaw!!) -// -// if ((rotDiff <= 10 || utilDiff <= 10) && !matrix.contains(entity.entityId)) { -//// if (debugValue.get()) Chat.alert("§7[§a§lAnti Bot/§6Matrix§7] §fPrevented §r${entity.gameProfile.name} §ffrom spawning.") -//// world.removeEntityFromWorld(entity.entityId) -// matrix.add(entity.entityId) -// if (debugValue.get()) Chat.alert("AntiBot + ${entity.gameProfile.name}") -// } -// -// if (entity.isSprinting && entity.moveForward == 0f && !matrix.contains(entity.entityId)) { -//// if (debugValue.get()) Chat.alert("§7[§a§lAnti Bot/§6Matrix§7] §fPrevented §r${entity.gameProfile.name} §ffrom spawning.") -//// world.removeEntityFromWorld(entity.entityId) -// matrix.add(entity.entityId) -// if (debugValue.get()) Chat.alert("AntiBot + ${entity.gameProfile.name}") -// } -// if (matrix.contains(entity.entityId)) { -// if (packet is S38PacketPlayerListItem && packet.action == S38PacketPlayerListItem.Action.REMOVE_PLAYER) { -// if (player.getDistanceToEntity(entity) < 10) matrix.remove(entity.entityId) -// } -// } -// } -// } -// } } } diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/player/InvManager.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/player/InvManager.kt index 52e0dda..e17b326 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/modules/player/InvManager.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/modules/player/InvManager.kt @@ -15,7 +15,7 @@ import net.ccbluex.liquidbounce.features.value.ListValue import net.ccbluex.liquidbounce.injection.access.IItemStack import net.ccbluex.liquidbounce.utils.ClientUtils import net.ccbluex.liquidbounce.utils.InventoryUtils -import net.ccbluex.liquidbounce.utils.InventoryUtils.amount +import net.ccbluex.liquidbounce.utils.InventoryUtils.canPlaceBlock import net.ccbluex.liquidbounce.utils.MovementUtils import net.ccbluex.liquidbounce.utils.MovementUtils.isMoving import net.ccbluex.liquidbounce.utils.PacketUtils @@ -637,6 +637,41 @@ object InvManager : Module() { return items } + val amount: IntArray + get() { + var missileAmount = 0 + var blockAmount = 0 + var arrowAmount = 0 + var foodAmount = 0 + var rod = 0 + mc.thePlayer.inventory.mainInventory.forEachIndexed { i, _ -> + val itemStack = mc.thePlayer.inventoryContainer.getSlot(i).stack + if (itemStack != null) { + when (itemStack.item) { + is ItemSnowball, is ItemEgg -> { + missileAmount += itemStack.stackSize + } + + is ItemBlock -> { + if (canPlaceBlock((itemStack.item as ItemBlock).block)) { + blockAmount += itemStack.stackSize + } + } + + is ItemFood -> { + foodAmount += itemStack.stackSize + } + + is ItemFishingRod -> rod += itemStack.stackSize + } + if (itemStack.unlocalizedName == "item.arrow") { + arrowAmount += itemStack.stackSize + } + } + } + return intArrayOf(missileAmount, blockAmount, arrowAmount,foodAmount,rod) + } + /** * Get type of [targetSlot] */ diff --git a/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinC08PacketPlayerBlockPlacement.java b/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinC08PacketPlayerBlockPlacement.java new file mode 100644 index 0000000..9d11971 --- /dev/null +++ b/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinC08PacketPlayerBlockPlacement.java @@ -0,0 +1,33 @@ +package net.ccbluex.liquidbounce.injection.forge.mixins.network; + +import net.ccbluex.liquidbounce.FDPClient; +import net.ccbluex.liquidbounce.features.module.modules.exploit.ViaVersionFix; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +import java.util.Objects; + +@Mixin(C08PacketPlayerBlockPlacement.class) +public class MixinC08PacketPlayerBlockPlacement { + @Shadow + public ItemStack stack; + + @ModifyConstant(method = "readPacketData", constant = @Constant(floatValue = 16.0F)) + private float ViaRightClickFix_A(float constant) { + if (Objects.requireNonNull(FDPClient.moduleManager.getModule(ViaVersionFix.class)).getState()) + return 1F; + return 16.0F; + } + + @ModifyConstant(method = "writePacketData", constant = @Constant(floatValue = 16.0F)) + private float ViaRightClickFix_B(float constant) { + if (Objects.requireNonNull(FDPClient.moduleManager.getModule(ViaVersionFix.class)).getState()) + return 1F; + return 16.0F; + } + +} diff --git a/src/main/java/net/ccbluex/liquidbounce/utils/InventoryUtils.kt b/src/main/java/net/ccbluex/liquidbounce/utils/InventoryUtils.kt index cef7959..323afb5 100644 --- a/src/main/java/net/ccbluex/liquidbounce/utils/InventoryUtils.kt +++ b/src/main/java/net/ccbluex/liquidbounce/utils/InventoryUtils.kt @@ -174,39 +174,4 @@ object InventoryUtils : MinecraftInstance(), Listenable { stack.item is ItemBlock && stack.stackSize > 0 && block.isFullCube && block !in BLOCK_BLACKLIST && block !is BlockBush }.maxByOrNull { inventory.getSlot(it).stack.stackSize } ?: -1 } - - val amount: IntArray - get() { - var missileAmount = 0 - var blockAmount = 0 - var arrowAmount = 0 - var foodAmount = 0 - var rod = 0 - mc.thePlayer.inventory.mainInventory.forEachIndexed { i, _ -> - val itemStack = mc.thePlayer.inventoryContainer.getSlot(i).stack - if (itemStack != null) { - when (itemStack.item) { - is ItemSnowball, is ItemEgg -> { - missileAmount += itemStack.stackSize - } - - is ItemBlock -> { - if (canPlaceBlock((itemStack.item as ItemBlock).block)) { - blockAmount += itemStack.stackSize - } - } - - is ItemFood -> { - foodAmount += itemStack.stackSize - } - - is ItemFishingRod -> rod += itemStack.stackSize - } - if (itemStack.unlocalizedName == "item.arrow") { - arrowAmount += itemStack.stackSize - } - } - } - return intArrayOf(missileAmount, blockAmount, arrowAmount,foodAmount,rod) - } } diff --git a/src/main/resources/fdpclient_at.cfg b/src/main/resources/fdpclient_at.cfg index 867f0b4..5b88e47 100644 --- a/src/main/resources/fdpclient_at.cfg +++ b/src/main/resources/fdpclient_at.cfg @@ -195,6 +195,8 @@ public net.minecraft.entity.EntityLivingBase field_70709_bj # newPosX public net.minecraft.entity.EntityLivingBase field_70710_bk # newPosY public net.minecraft.entity.EntityLivingBase field_110152_bk # newPosZ +public net.minecraft.entity.player.EntityPlayer field_71074_e # itemInUse + # BlockLiquid public net.minecraft.block.BlockLiquid func_176362_e(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/BlockPos;)I # getLevel diff --git a/src/main/resources/mixins.fdpclient.json b/src/main/resources/mixins.fdpclient.json index f442f60..5d7525a 100644 --- a/src/main/resources/mixins.fdpclient.json +++ b/src/main/resources/mixins.fdpclient.json @@ -55,13 +55,14 @@ "gui.MixinGuiSpectator", "gui.MixinGuiTextField", "gui.MixinServerListEntryNormal", - "network.MixinNetworkPlayerInfo", "network.MixinBlockedServers", "network.MixinC00Handshake", + "network.MixinC08PacketPlayerBlockPlacement", "network.MixinC17PacketCustomPayload", "network.MixinNetHandlerPlayClient", "network.MixinNetworkManager", "network.MixinNetworkManagerChInit", + "network.MixinNetworkPlayerInfo", "network.MixinS3FPacketCustomPayload", "patcher.bugfixes.MixinBlockFluidRenderer", "patcher.bugfixes.MixinClientCommandHandler",