From 6a9030b259c619eac2d90c2a5637674e7d47d391 Mon Sep 17 00:00:00 2001 From: Aspw-w <0kcabtuo0@gmail.com> Date: Thu, 11 Apr 2024 18:50:34 +0900 Subject: [PATCH] Improve CjamgeRr --- src/main/java/net/aspw/client/Launch.kt | 2 +- .../client/features/api/PacketManager.java | 6 +-- .../client/features/module/ModuleManager.kt | 3 +- .../module/impl/other/PacketTracker.kt | 35 +++++++++++++ .../aspw/client/visual/client/GuiMainMenu.kt | 50 +++++++++++++++---- 5 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 src/main/java/net/aspw/client/features/module/impl/other/PacketTracker.kt diff --git a/src/main/java/net/aspw/client/Launch.kt b/src/main/java/net/aspw/client/Launch.kt index 7ba512eb..1447d1ba 100644 --- a/src/main/java/net/aspw/client/Launch.kt +++ b/src/main/java/net/aspw/client/Launch.kt @@ -31,7 +31,7 @@ object Launch { const val CLIENT_BEST = "NightX" const val CLIENT_FOLDER = "NightX-Client" const val CLIENT_VERSION = "B106" - const val CLIENT_CHAT = "§c$CLIENT_BEST: §r" + const val CLIENT_CHAT = "§c[$CLIENT_BEST] §r" const val CLIENT_PROTOCOL_RANGE = "1.7.2 to 1.20.4" var isStarting = false diff --git a/src/main/java/net/aspw/client/features/api/PacketManager.java b/src/main/java/net/aspw/client/features/api/PacketManager.java index 15b2cf92..4e082994 100644 --- a/src/main/java/net/aspw/client/features/api/PacketManager.java +++ b/src/main/java/net/aspw/client/features/api/PacketManager.java @@ -9,13 +9,13 @@ import net.aspw.client.features.module.impl.visual.Animations; import net.aspw.client.features.module.impl.visual.SilentRotations; import net.aspw.client.protocol.api.ProtocolFixes; -import net.aspw.client.utils.AnimationUtils; -import net.aspw.client.utils.MinecraftInstance; -import net.aspw.client.utils.RotationUtils; +import net.aspw.client.utils.*; import net.aspw.client.utils.render.RenderUtils; import net.aspw.client.utils.timer.MSTimer; import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C00PacketKeepAlive; import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; import java.util.Objects; diff --git a/src/main/java/net/aspw/client/features/module/ModuleManager.kt b/src/main/java/net/aspw/client/features/module/ModuleManager.kt index e31c4f83..3a64c8dc 100644 --- a/src/main/java/net/aspw/client/features/module/ModuleManager.kt +++ b/src/main/java/net/aspw/client/features/module/ModuleManager.kt @@ -155,7 +155,8 @@ class ModuleManager : Listenable { DrinkingAlert::class.java, AutoGetter::class.java, Spammer::class.java, - PacketMine::class.java + PacketMine::class.java, + PacketTracker::class.java ) ClientUtils.getLogger().info("Successfully loaded modules") diff --git a/src/main/java/net/aspw/client/features/module/impl/other/PacketTracker.kt b/src/main/java/net/aspw/client/features/module/impl/other/PacketTracker.kt new file mode 100644 index 00000000..e54de68b --- /dev/null +++ b/src/main/java/net/aspw/client/features/module/impl/other/PacketTracker.kt @@ -0,0 +1,35 @@ +package net.aspw.client.features.module.impl.other + +import io.netty.buffer.Unpooled +import net.aspw.client.event.EventTarget +import net.aspw.client.event.PacketEvent +import net.aspw.client.features.module.Module +import net.aspw.client.features.module.ModuleCategory +import net.aspw.client.features.module.ModuleInfo +import net.aspw.client.utils.PacketUtils +import net.aspw.client.utils.misc.RandomUtils +import net.aspw.client.value.BoolValue +import net.aspw.client.value.ListValue +import net.aspw.client.value.TextValue +import net.minecraft.network.PacketBuffer +import net.minecraft.network.play.client.C00PacketKeepAlive +import net.minecraft.network.play.client.C0FPacketConfirmTransaction +import net.minecraft.network.play.client.C13PacketPlayerAbilities +import net.minecraft.network.play.client.C17PacketCustomPayload + +@ModuleInfo(name = "PacketTracker", spacedName = "Packet Tracker", category = ModuleCategory.OTHER) +class PacketTracker : Module() { + private val transactionIDValue = BoolValue("Transaction-ID", true) + private val keepAliveKeyValue = BoolValue("KeepAlive-Key", false) + + @EventTarget + fun onPacket(event: PacketEvent) { + val packet = event.packet + + if (transactionIDValue.get() && packet is C0FPacketConfirmTransaction) + chat("§c[Transaction ID]: §r" + packet.uid.toString()) + + if (keepAliveKeyValue.get() && packet is C00PacketKeepAlive) + chat("§c[KeepAlive Key]: §r" + packet.key.toString()) + } +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/visual/client/GuiMainMenu.kt b/src/main/java/net/aspw/client/visual/client/GuiMainMenu.kt index 75662851..6432b89a 100644 --- a/src/main/java/net/aspw/client/visual/client/GuiMainMenu.kt +++ b/src/main/java/net/aspw/client/visual/client/GuiMainMenu.kt @@ -114,8 +114,8 @@ class GuiMainMenu : GuiScreen(), GuiYesNoCallback { ) FontLoaders.SF20.drawStringWithShadow( Launch.CLIENT_BEST + " Client - " + Launch.CLIENT_PROTOCOL_RANGE, - 4F.toDouble(), - height - 12F.toDouble(), + width - 4F - FontLoaders.SF20.getStringWidth(Launch.CLIENT_BEST + " Client - " + Launch.CLIENT_PROTOCOL_RANGE).toDouble(), + height - 23F.toDouble(), -1 ) val uiMessage = @@ -136,17 +136,47 @@ class GuiMainMenu : GuiScreen(), GuiYesNoCallback { var changeY = 16 val changeDetails = APIConnecter.changelogs.split("\n") for (i in changeDetails) { - FontLoaders.SF20.drawStringWithShadow( - i, - 4F.toDouble(), - changeY.toDouble(), - -1 - ) - changeY += 11 + if (i.startsWith("~ ")) { + FontLoaders.SF16.drawStringWithShadow( + "§r $i".uppercase(), + 4F.toDouble(), + changeY.toDouble(), + -1 + ) + } else if (i.startsWith("+ ")) { + FontLoaders.SF16.drawStringWithShadow( + "§a $i", + 4F.toDouble(), + changeY.toDouble(), + -1 + ) + } else if (i.startsWith("- ")) { + FontLoaders.SF16.drawStringWithShadow( + "§c $i", + 4F.toDouble(), + changeY.toDouble(), + -1 + ) + } else if (i.startsWith("* ")) { + FontLoaders.SF16.drawStringWithShadow( + "§e $i", + 4F.toDouble(), + changeY.toDouble(), + -1 + ) + } else { + FontLoaders.SF16.drawStringWithShadow( + i, + 4F.toDouble(), + changeY.toDouble(), + -1 + ) + } + changeY += 8 } FontLoaders.SF21.drawStringWithShadow( "Known Bugs:", - (this.width - 6F - FontLoaders.SF21.getStringWidth("Known Bugs")).toDouble(), + (this.width - 3F - FontLoaders.SF21.getStringWidth("Known Bugs:")).toDouble(), 48F.toDouble(), -1 )