diff --git a/agent/src/main/kotlin/io/github/nilsen84/lcqt/Config.kt b/agent/src/main/kotlin/io/github/nilsen84/lcqt/Config.kt index f8ff35d..4939641 100644 --- a/agent/src/main/kotlin/io/github/nilsen84/lcqt/Config.kt +++ b/agent/src/main/kotlin/io/github/nilsen84/lcqt/Config.kt @@ -7,4 +7,5 @@ class Config { val cosmeticsEnabled: Boolean = false val freelookEnabled: Boolean = false val crackedEnabled: Boolean = false + val noHitDelayEnabled: Boolean = false } \ No newline at end of file diff --git a/agent/src/main/kotlin/io/github/nilsen84/lcqt/LcqtPatcher.kt b/agent/src/main/kotlin/io/github/nilsen84/lcqt/LcqtPatcher.kt index f6ed6a2..b416fd9 100644 --- a/agent/src/main/kotlin/io/github/nilsen84/lcqt/LcqtPatcher.kt +++ b/agent/src/main/kotlin/io/github/nilsen84/lcqt/LcqtPatcher.kt @@ -24,12 +24,12 @@ object LcqtPatcher { if (config.cosmeticsEnabled) patches += CosmeticsPatch() if (config.freelookEnabled) patches += FreelookPatch() if (config.crackedEnabled) patches += CrackedAccountPatch() + if (config.noHitDelayEnabled) patches += NoHitDelayPatch() println("RUNNING LCQT WITH PATCHES: " + patches.joinToString { it::class.simpleName!! }) - inst.addTransformer(Transformer(patches)) } diff --git a/agent/src/main/kotlin/io/github/nilsen84/lcqt/patches/NoHitDelayPatch.kt b/agent/src/main/kotlin/io/github/nilsen84/lcqt/patches/NoHitDelayPatch.kt new file mode 100644 index 0000000..5939ca3 --- /dev/null +++ b/agent/src/main/kotlin/io/github/nilsen84/lcqt/patches/NoHitDelayPatch.kt @@ -0,0 +1,28 @@ +package io.github.nilsen84.lcqt.patches + +import io.github.nilsen84.lcqt.Patch +import org.objectweb.asm.Opcodes +import org.objectweb.asm.tree.ClassNode +import org.objectweb.asm.tree.FieldInsnNode +import org.objectweb.asm.tree.IntInsnNode + +class NoHitDelayPatch : Patch() { + override fun transform(cn: ClassNode): Boolean { + if (cn.name != "net/minecraft/client/Minecraft") { + return false + } + + val clickMouse = cn.methods.find { it.name == "clickMouse" } ?: return false + + val instructions = clickMouse.instructions + .filterIsInstance() + .filter { + it.opcode == Opcodes.BIPUSH && it.operand == 10 && it.next.let { + it is FieldInsnNode && it.name == "leftClickCounter" + } + } + .onEach { it.operand = 0 } + + return instructions.isNotEmpty() + } +} \ No newline at end of file diff --git a/gui/src/App.svelte b/gui/src/App.svelte index 0f40faa..92100da 100644 --- a/gui/src/App.svelte +++ b/gui/src/App.svelte @@ -13,6 +13,8 @@ freelookEnabled: boolean, + noHitDelayEnabled: boolean, + jvmEnabled: boolean, customJvm: boolean, customJvmPath: string, @@ -27,6 +29,8 @@ freelookEnabled: false, + noHitDelayEnabled: false, + jvmEnabled: true, customJvm: false, customJvmPath: '', @@ -96,6 +100,8 @@ + +