Skip to content

Commit

Permalink
Watchdog Flag Disabler
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Jan 7, 2024
1 parent 3392f77 commit 045af67
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/aspw/client/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ import net.minecraft.util.ResourceLocation
object Client {

// Client information
const val isInDevelopment = true
const val isInDevelopment = false

const val CLIENT_BEST = "NightX"
const val CLIENT_FOLDER = "NightWare"
const val CLIENT_VERSION = "Beta B80"
const val CLIENT_VERSION = "Release B80"
const val CLIENT_CREATOR = "As_pw"
const val CLIENT_WEBSITE = "https://aspw-w.github.io/NightX-Web"
const val CLIENT_ANNOUNCEMENT = "$CLIENT_WEBSITE/database/announcement.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Disabler : Module() {
private val vanilladesync = BoolValue("Vanilla-Desync", false)
private val silentaccept = BoolValue("Silent-Accept", false)
private val shotbow = BoolValue("ShotBow", false)
private val watchdogflag = BoolValue("Watchdog-Flag", false)
private val funcraftstaff = BoolValue("Funcraft-Staff", false)
private val blockdrop = BoolValue("BlockDrop", false)
private val grim = BoolValue("Grim", false)
Expand Down Expand Up @@ -226,6 +227,7 @@ class Disabler : Module() {
private var alrSprint = false

private var expectedSetback = false
private var flagged = false

private var packetCount = 0

Expand Down Expand Up @@ -325,6 +327,7 @@ class Disabler : Module() {
}

override fun onDisable() {
flagged = false
pre = false
Client.moduleManager.getModule(VulcanEatCore::class.java)?.state = false
pendingFlagApplyPacket = false
Expand Down Expand Up @@ -371,13 +374,24 @@ class Disabler : Module() {
mc.timer.timerSpeed = 1F
}

@EventTarget
fun onTeleport(event: TeleportEvent) {
if (watchdogflag.get()) {
debug("Flagged")
flagged = true
}
}

@EventTarget
fun onWorld(event: WorldEvent) {
if (oldwatchdog2.get()) {
counter = 0
inCage = true
}

if (watchdogflag.get())
flagged = false

if (vulcancombat.get()) {
BlinkUtils.clearPacket(packetType = "C0FPacketConfirmTransaction")
currentTrans = 0
Expand Down Expand Up @@ -537,6 +551,34 @@ class Disabler : Module() {
fun onPacket(event: PacketEvent) {
val packet = event.packet

if (watchdogflag.get()) {
if (packet is C03PacketPlayer && flagged) {
debug("Sent Fix Packet")
event.cancelEvent()
PacketUtils.sendPacketNoEvent(
C06PacketPlayerPosLook(
packet.x,
packet.y,
packet.z,
packet.yaw,
packet.pitch,
packet.onGround
)
)
PacketUtils.sendPacketNoEvent(
C06PacketPlayerPosLook(
mc.thePlayer.posX,
mc.thePlayer.posY,
mc.thePlayer.posZ,
mc.thePlayer.rotationYaw,
mc.thePlayer.rotationPitch,
mc.thePlayer.onGround
)
)
flagged = false
}
}

if (boat.get()) {
if (mc.thePlayer.ridingEntity != null) {
canModify = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import net.aspw.client.event.*
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.util.MovementUtils
import net.aspw.client.value.BoolValue
import net.aspw.client.value.ListValue
import net.minecraft.client.gui.GuiChat
Expand All @@ -20,7 +19,6 @@ class InvMove : Module() {

val modeValue = ListValue("Mode", arrayOf("Vanilla", "Silent", "Blink"), "Silent")
private val noDetectableValue = BoolValue("NoDetectable", false)
private val noMoveClicksValue = BoolValue("NoMoveClicks", false)

private val playerPackets = mutableListOf<C03PacketPlayer>()

Expand All @@ -47,12 +45,6 @@ class InvMove : Module() {
}
}

@EventTarget
fun onClick(event: ClickWindowEvent) {
if (noMoveClicksValue.get() && MovementUtils.isMoving())
event.cancelEvent()
}

@EventTarget
fun onPacket(event: PacketEvent) {
val packet = event.packet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ class WatchdogGround : SpeedMode("WatchdogGround") {
if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) {
MovementUtils.strafe(0.58f)
} else {
MovementUtils.strafe(0.466f)
MovementUtils.strafe(0.46f)
}
} else if (mc.thePlayer.fallDistance > 0.1 && mc.thePlayer.hurtTime != 0) {
if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) {
MovementUtils.strafe(0.18f)
} else {
MovementUtils.strafe(0.14f)
}
}
}
Expand Down

0 comments on commit 045af67

Please sign in to comment.