-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Much more Modules and dupebook command
- Loading branch information
1 parent
d7d1168
commit 9c6a55a
Showing
8 changed files
with
367 additions
and
5 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
src/main/kotlin/com/lambda/client/command/commands/DupeBookCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.lambda.client.command.commands | ||
|
||
import com.lambda.client.command.ClientCommand | ||
import com.lambda.client.event.SafeExecuteEvent | ||
import com.lambda.client.util.items.itemPayload | ||
import com.lambda.client.util.text.MessageSendHelper | ||
import net.minecraft.item.ItemWritableBook | ||
import net.minecraft.nbt.NBTTagList | ||
import net.minecraft.nbt.NBTTagString | ||
import java.util.* | ||
import java.util.stream.Collectors | ||
|
||
/** | ||
* @author 0x2E | PretendingToCode | ||
* @author EarthComputer | ||
* | ||
* The characterGenerator is from here: https://github.com/ImpactDevelopment/ImpactIssues/issues/1123#issuecomment-482721273 | ||
* Which was written by EarthComputer for both EvilSourcerer and 0x2E | ||
*/ | ||
object DupeBookCommand : ClientCommand( | ||
name = "dupebook", | ||
alias = arrayOf("bookbot"), | ||
description = "Generates books used for chunk save state dupe." | ||
) { | ||
init { | ||
boolean("sign book") { signBookArg -> | ||
executeSafe { | ||
createBook(signBookArg.value) | ||
} | ||
} | ||
|
||
executeSafe { | ||
createBook(false) | ||
} | ||
} | ||
|
||
private fun SafeExecuteEvent.createBook(sign: Boolean) { | ||
val heldItem = player.inventory.getCurrentItem() | ||
|
||
if (heldItem.item is ItemWritableBook) { | ||
val characterGenerator = Random() | ||
.ints(0x80, 0x10ffff - 0x800) | ||
.map { if (it < 0xd800) it else it + 0x800 } | ||
|
||
val joinedPages = characterGenerator | ||
.limit(50 * 210L) | ||
.mapToObj { it.toChar().toString() } // this has to be turned into a Char first, otherwise you will get the raw Int value | ||
.collect(Collectors.joining()) | ||
|
||
val pages = NBTTagList() | ||
val title = if (sign) UUID.randomUUID().toString().substring(0, 5) else "" | ||
|
||
for (page in 0..49) { | ||
pages.appendTag(NBTTagString(joinedPages.substring(page * 210, (page + 1) * 210))) | ||
} | ||
|
||
if (heldItem.hasTagCompound()) { | ||
heldItem.tagCompound!!.setTag("pages", pages) | ||
heldItem.tagCompound!!.setTag("title", NBTTagString(title)) | ||
heldItem.tagCompound!!.setTag("author", NBTTagString(player.name)) | ||
} else { | ||
heldItem.setTagInfo("pages", pages) | ||
heldItem.setTagInfo("title", NBTTagString(title)) | ||
heldItem.setTagInfo("author", NBTTagString(player.name)) | ||
} | ||
|
||
itemPayload(heldItem, "MC|BEdit") | ||
|
||
if (sign) { | ||
itemPayload(heldItem, "MC|BSign") | ||
} | ||
|
||
MessageSendHelper.sendChatMessage("Dupe book generated.") | ||
} else { | ||
MessageSendHelper.sendErrorMessage("You must be holding a writable book.") | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/main/kotlin/com/lambda/client/module/modules/combat/AntiBot.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package com.lambda.client.module.modules.combat | ||
|
||
import com.lambda.client.event.SafeClientEvent | ||
import com.lambda.client.event.events.PlayerAttackEvent | ||
import com.lambda.client.event.events.ConnectionEvent | ||
import com.lambda.client.module.Category | ||
import com.lambda.client.module.Module | ||
import com.lambda.client.module.modules.misc.FakePlayer | ||
import com.lambda.client.util.math.Vec2d | ||
import com.lambda.client.util.threads.safeListener | ||
import com.lambda.event.listener.listener | ||
import net.minecraft.entity.Entity | ||
import net.minecraft.entity.player.EntityPlayer | ||
import net.minecraftforge.fml.common.gameevent.TickEvent | ||
import kotlin.math.abs | ||
|
||
object AntiBot : Module( | ||
name = "AntiBot", | ||
description = "Avoid attacking fake players", | ||
category = Category.COMBAT, | ||
alwaysListening = true | ||
) { | ||
private val tabList by setting("Tab List", true) | ||
private val ping by setting("Ping", true) | ||
private val hp by setting("HP", true) | ||
private val sleeping by setting("Sleeping", false) | ||
private val hoverOnTop by setting("Hover On Top", true) | ||
private val ticksExists by setting("Ticks Exists", 200, 0..500, 10) | ||
|
||
private val botSet = HashSet<EntityPlayer>() | ||
|
||
init { | ||
listener<ConnectionEvent.Disconnect> { | ||
botSet.clear() | ||
} | ||
|
||
listener<PlayerAttackEvent> { | ||
if (isEnabled && botSet.contains(it.entity)) it.cancel() | ||
} | ||
|
||
safeListener<TickEvent.ClientTickEvent> { | ||
val cacheSet = HashSet<EntityPlayer>() | ||
for (entity in world.loadedEntityList) { | ||
if (entity !is EntityPlayer) continue | ||
if (entity == player) continue | ||
if (!isBot(entity)) continue | ||
cacheSet.add(entity) | ||
} | ||
botSet.removeIf { !cacheSet.contains(it) } | ||
botSet.addAll(cacheSet) | ||
} | ||
} | ||
|
||
fun isBot(entity: Entity) = isEnabled && entity is EntityPlayer && botSet.contains(entity) | ||
|
||
private fun SafeClientEvent.isBot(entity: EntityPlayer) = entity.name == player.name | ||
|| entity.name == FakePlayer.playerName | ||
|| tabList && connection.getPlayerInfo(entity.name) == null | ||
|| ping && connection.getPlayerInfo(entity.name)?.responseTime ?: -1 <= 0 | ||
|| hp && entity.health !in 0f..20f | ||
|| sleeping && entity.isPlayerSleeping && !entity.onGround | ||
|| hoverOnTop && hoverCheck(entity) | ||
|| entity.ticksExisted < ticksExists | ||
|
||
private fun SafeClientEvent.hoverCheck(entity: EntityPlayer): Boolean { | ||
val distXZ = Vec2d(entity.posX, entity.posZ).minus(player.posX, player.posZ).lengthSquared() | ||
return distXZ < 16 && entity.posY - player.posY > 2.0 && abs(entity.posY - entity.prevPosY) < 0.1 | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
src/main/kotlin/com/lambda/client/module/modules/combat/InfiniteAura.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package com.lambda.client.module.modules.combat | ||
|
||
import com.lambda.client.manager.managers.CombatManager | ||
import com.lambda.client.module.Category | ||
import com.lambda.client.module.Module | ||
import com.lambda.client.util.text.MessageSendHelper | ||
import com.lambda.client.util.threads.safeListener | ||
import net.minecraft.entity.EntityLivingBase | ||
import net.minecraft.network.play.client.CPacketPlayer | ||
import net.minecraftforge.fml.common.gameevent.TickEvent | ||
|
||
object TpAura : Module( | ||
name = "TpAura", | ||
description = "KillAura with infinite reach (Infinite as in to the edge of the render distance if good config)", | ||
category = Category.COMBAT, | ||
modulePriority = 120 | ||
) { | ||
val mode by setting("Mode", Mode.FAST) | ||
|
||
val delay by setting("Tick Delay", 2, 1..200, 1) | ||
val disableOnDeath by setting("Death Disable", true) | ||
|
||
|
||
val range by setting("Range", 50, 5..500, 1) | ||
|
||
var timer = 0 | ||
|
||
init { | ||
onEnable { | ||
timer = 0 | ||
} | ||
onDisable { | ||
timer = 0 | ||
} | ||
|
||
safeListener<TickEvent.ClientTickEvent> { | ||
if (it.phase != TickEvent.Phase.START) { | ||
return@safeListener | ||
} | ||
|
||
timer++ | ||
if (timer <= delay) { | ||
MessageSendHelper.sendChatMessage("timer'd @ $timer") | ||
return@safeListener | ||
} | ||
timer = 0 | ||
|
||
if (!player.isEntityAlive) { | ||
if (disableOnDeath) { | ||
disable() | ||
} | ||
return@safeListener | ||
} | ||
val target = CombatManager.target ?: return@safeListener | ||
|
||
MessageSendHelper.sendChatMessage("e") | ||
|
||
if (!CombatManager.isOnTopPriority(TpAura) || CombatSetting.pause) return@safeListener | ||
if (player.getDistance(target) >= range) return@safeListener | ||
|
||
doTpHit(target) | ||
} | ||
} | ||
|
||
private fun doTpHit(target: EntityLivingBase) { | ||
|
||
if (mode == Mode.FAST) { | ||
MessageSendHelper.sendChatMessage("Attacked ${target.name}") | ||
|
||
mc.player.connection.sendPacket(CPacketPlayer.Position(target.posX, target.posY, target.posZ, false)) | ||
mc.playerController.attackEntity(mc.player, target) | ||
mc.player.connection.sendPacket(CPacketPlayer.Position(mc.player.posX, mc.player.posY, mc.player.posZ, mc.player.onGround)) | ||
} | ||
} | ||
|
||
enum class Mode { | ||
FAST, | ||
GOOD | ||
} | ||
} |
94 changes: 94 additions & 0 deletions
94
src/main/kotlin/com/lambda/client/module/modules/movement/PacketFileExploit.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package com.lambda.client.module.modules.movement | ||
|
||
import com.lambda.client.event.Phase | ||
import com.lambda.client.event.events.OnUpdateWalkingPlayerEvent | ||
import com.lambda.client.event.events.PlayerTravelEvent | ||
import com.lambda.client.module.Category | ||
import com.lambda.client.module.Module | ||
import com.lambda.client.util.MovementUtils | ||
import com.lambda.client.util.MovementUtils.calcMoveYaw | ||
import com.lambda.client.util.PacketEvent | ||
import com.lambda.client.util.threads.safeListener | ||
import com.lambda.event.listener.listener | ||
import net.minecraft.network.play.client.CPacketPlayer | ||
import net.minecraft.network.play.server.SPacketCloseWindow | ||
import net.minecraftforge.fml.common.gameevent.TickEvent | ||
import kotlin.math.cos | ||
import kotlin.math.sin | ||
|
||
object PacketFlyExploit : Module( | ||
name = "PacketFly", | ||
description = "Allows you to fly by exploiting NoCheatPlus", | ||
category = Category.MOVEMENT | ||
) { | ||
|
||
val mode by setting("Mode", Mode.FAST) | ||
val ySpeed by setting("YSpeed", 0.05, 0.01..1.0, 0.01) | ||
val delay by setting("Delay", 1, 0..20, 1) | ||
|
||
var timer = 0 | ||
|
||
|
||
init { | ||
safeListener<PlayerTravelEvent> { | ||
if (mode == Mode.FAST) { | ||
|
||
timer++ | ||
if (timer < delay) { | ||
return@safeListener | ||
} | ||
timer = 0 | ||
|
||
|
||
if (mc.gameSettings.keyBindJump.isKeyDown) { | ||
mc.player.connection.sendPacket(CPacketPlayer.PositionRotation(mc.player.posX, mc.player.posY - ySpeed, mc.player.posZ, 0f, 0f, mc.player.onGround)) | ||
} else if (mc.gameSettings.keyBindSneak.isKeyDown) { | ||
mc.player.connection.sendPacket(CPacketPlayer.PositionRotation(mc.player.posX, mc.player.posY + ySpeed, mc.player.posZ, 0f, 0f, mc.player.onGround)) | ||
} | ||
|
||
mc.player.connection.sendPacket(CPacketPlayer.PositionRotation(mc.player.posX, -1337.0, mc.player.posZ, 0f, 0f, true)) | ||
} else if (mode == Mode.OLD) { | ||
it.cancel() | ||
|
||
player.motionY = if (mc.gameSettings.keyBindJump.isKeyDown xor mc.gameSettings.keyBindSneak.isKeyDown) { | ||
if (mc.gameSettings.keyBindJump.isKeyDown) { | ||
0.0622 | ||
} | ||
else -0.0622 | ||
} else { | ||
if (MovementUtils.isInputting) { | ||
val yaw = calcMoveYaw() | ||
player.motionX = -sin(yaw) * 0.2f | ||
player.motionZ = cos(yaw) * 0.2f | ||
} | ||
-ySpeed | ||
} | ||
|
||
val posX = player.posX + player.motionX | ||
val posY = player.posY + player.motionY | ||
val posZ = player.posZ + player.motionZ | ||
|
||
connection.sendPacket(CPacketPlayer.PositionRotation(posX, posY, posZ, player.rotationYaw, player.rotationPitch, false)) | ||
connection.sendPacket(CPacketPlayer.Position(posX, player.posY - 42069, posZ, true)) | ||
} | ||
} | ||
|
||
listener<OnUpdateWalkingPlayerEvent> { | ||
if (mode == Mode.OLD && it.phase == Phase.PRE) { | ||
return@listener | ||
} | ||
} | ||
|
||
listener<PacketEvent.Receive> { | ||
if (mode == Mode.OLD && it.packet is SPacketCloseWindow) { | ||
it.cancel() | ||
} | ||
} | ||
} | ||
|
||
enum class Mode { | ||
OLD, | ||
FAST, | ||
VANILLA // todo: vanilla mode (for phasing) | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/kotlin/com/lambda/client/module/modules/player/EndTeleport.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.lambda.client.module.modules.player | ||
|
||
import com.lambda.client.module.Category | ||
import com.lambda.client.module.Module | ||
import com.lambda.client.util.PacketEvent | ||
import com.lambda.client.util.text.MessageSendHelper | ||
import com.lambda.client.util.threads.safeListener | ||
import net.minecraft.network.play.server.SPacketDisconnect | ||
import net.minecraft.network.play.server.SPacketRespawn | ||
import net.minecraft.util.text.TextComponentString | ||
|
||
object EndTeleport : Module( | ||
name = "EndTeleport", | ||
category = Category.PLAYER, | ||
description = "Allows for teleportation when going through end portals" | ||
) { | ||
private val confirmed by setting("Confirm", false) | ||
|
||
init { | ||
onEnable { | ||
if (mc.currentServerData == null) { | ||
MessageSendHelper.sendWarningMessage("$chatName This module does not work in singleplayer") | ||
disable() | ||
} else if (!confirmed) { | ||
MessageSendHelper.sendWarningMessage("$chatName This module will kick you from the server! It is part of the exploit and cannot be avoided") | ||
} | ||
} | ||
|
||
safeListener<PacketEvent.Receive> { | ||
if (it.packet !is SPacketRespawn) return@safeListener | ||
if (it.packet.dimensionID == 1 && confirmed) { | ||
connection.handleDisconnect(SPacketDisconnect(TextComponentString("Attempting teleportation exploit"))) | ||
disable() | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.