Skip to content

Commit

Permalink
Improve CjamgeRr
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Apr 11, 2024
1 parent 97e5abe commit 6a9030b
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/aspw/client/Launch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/aspw/client/features/api/PacketManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
@@ -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())
}
}
50 changes: 40 additions & 10 deletions src/main/java/net/aspw/client/visual/client/GuiMainMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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
)
Expand Down

0 comments on commit 6a9030b

Please sign in to comment.