Skip to content

Commit

Permalink
B71!
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Oct 30, 2023
1 parent c0470d6 commit 25009e4
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 82 deletions.
18 changes: 9 additions & 9 deletions NightX.iws
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</component>
<component name="ChangeListManager">
<list default="true" id="af093b99-5942-419c-869b-8b2d7cb4dd2a" name="変更" comment="">
<change afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/other/ChatFilter.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/NightX.iws" beforeDir="false" afterPath="$PROJECT_DIR$/NightX.iws" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/ModuleManager.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/ModuleManager.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/Client.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/Client.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/combat/AntiStaff.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/combat/AntiStaff.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/other/KeepChest.kt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/combat/KillAura.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/module/impl/combat/KillAura.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityLivingBase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityLivingBase.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
Expand Down Expand Up @@ -192,7 +192,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down Expand Up @@ -252,7 +252,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down Expand Up @@ -294,7 +294,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -309,7 +309,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down Expand Up @@ -354,7 +354,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -369,7 +369,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/aspw/client/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import kotlin.concurrent.thread
object Client {

// Client information
val clientVersion = ListValue("ClientVersion", arrayOf("Release", "Beta", "Developer"), "Beta")
val clientVersion = ListValue("ClientVersion", arrayOf("Release", "Beta", "Developer"), "Release")
const val CLIENT_BEST = "NightX"
const val CLIENT_FOLDER = "NightX-Reloaded"
const val CLIENT_VERSION = "Beta B71"
const val CLIENT_CREATOR = "As_pw, Maple, outaokura"
const val CLIENT_FOLDER = "NightX-Continued"
const val CLIENT_VERSION = "Release B71"
const val CLIENT_CREATOR = "As_pw, outaokura"
const val CLIENT_WEBSITE = "https://aspw-w.github.io/NightX-Web"
const val CLIENT_CONFIG = "$CLIENT_WEBSITE/data/configs.txt"
const val CLIENT_SRG = "$CLIENT_WEBSITE/data/srg.txt"
Expand Down
219 changes: 157 additions & 62 deletions src/main/java/net/aspw/client/features/module/impl/combat/AntiStaff.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,116 +3,211 @@ package net.aspw.client.features.module.impl.combat
//import net.minecraft.network.play.server.S02PacketChat

import net.aspw.client.Client
import net.aspw.client.auth.utils.HttpUtils
import net.aspw.client.event.EventTarget
import net.aspw.client.event.PacketEvent
import net.aspw.client.event.UpdateEvent
import net.aspw.client.event.WorldEvent
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.EntityUtils
import net.aspw.client.util.render.ColorUtils
import net.aspw.client.value.BoolValue
import net.aspw.client.value.ListValue
import net.aspw.client.visual.hud.element.elements.Notification
import net.minecraft.network.play.server.*
import kotlin.concurrent.thread

@ModuleInfo(name = "AntiStaff", spacedName = "Anti Staff", description = "", category = ModuleCategory.COMBAT)
class AntiStaff : Module() {
private val modeValue = ListValue("Mode", arrayOf("Anywhere", "BlocksMC"), "Anywhere")
private val leaveValue = BoolValue("Leave", true) { modeValue.get().equals("blocksmc", true) }

private var obStaffs = "_"
private var detected = false
private var totalCount = 0

private var staffs = mutableListOf<String>()
private var staffsInWorld = mutableListOf<String>()
private var staffList: String = "${Client.CLIENT_WEBSITE}/data/bmcstafflist.txt"

override fun onInitialize() {
thread {
totalCount = obStaffs.count { it.isWhitespace() }
staffs.addAll(HttpUtils.get(staffList).split(","))
}
}

override val tag: String
get() = modeValue.get()

override fun onEnable() {
detected = false
staffsInWorld.clear()
}

@EventTarget
fun onWorld(e: WorldEvent) {
detected = false
staffsInWorld.clear()
}

private fun warn(name: String) {
if (name in staffsInWorld)
return
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
if (leaveValue.get())
mc.thePlayer.sendChatMessage("/leave")
staffsInWorld.add(name)
}

@EventTarget
fun onUpdate(event: UpdateEvent) {
if (modeValue.get().equals("blocksmc", true)) {
for (networkPlayerInfo in mc.netHandler.playerInfoMap) {
val networkName = ColorUtils.stripColor(EntityUtils.getName(networkPlayerInfo)) ?: continue
if (networkName in staffs)
warn(networkName)
}
}
}

@EventTarget
fun onPacket(event: PacketEvent) {
if (mc.theWorld == null || mc.thePlayer == null) return
if (mc.thePlayer.ticksExisted % 3 == 0 && detected) detected = false
val packet = event.packet
if (packet is S1DPacketEntityEffect) {
val entity = mc.theWorld.getEntityByID(packet.entityId)
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true

when (modeValue.get().lowercase()) {
"anywhere" -> {
if (mc.thePlayer.ticksExisted % 3 == 0 && detected) detected = false
if (packet is S1DPacketEntityEffect) {
val entity = mc.theWorld.getEntityByID(packet.entityId)
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
}
}
}
}
}
if (packet is S18PacketEntityTeleport) {
val entity = mc.theWorld.getEntityByID(packet.entityId)
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
if (packet is S18PacketEntityTeleport) {
val entity = mc.theWorld.getEntityByID(packet.entityId)
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
}
}
}
}
}
if (packet is S20PacketEntityProperties) {
val entity = mc.theWorld.getEntityByID(packet.entityId)
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
if (packet is S20PacketEntityProperties) {
val entity = mc.theWorld.getEntityByID(packet.entityId)
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
}
}
}
}
}
if (packet is S0BPacketAnimation) {
val entity = mc.theWorld.getEntityByID(packet.entityID)
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
if (packet is S0BPacketAnimation) {
val entity = mc.theWorld.getEntityByID(packet.entityID)
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
}
}
}
}
}
if (packet is S14PacketEntity) {
val entity = packet.getEntity(mc.theWorld)
if (packet is S14PacketEntity) {
val entity = packet.getEntity(mc.theWorld)

if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
}
}
}
}
}
if (packet is S19PacketEntityStatus) {
val entity = packet.getEntity(mc.theWorld)
if (packet is S19PacketEntityStatus) {
val entity = packet.getEntity(mc.theWorld)

if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
}
}
}
}
}
if (packet is S19PacketEntityHeadLook) {
val entity = packet.getEntity(mc.theWorld)
if (packet is S19PacketEntityHeadLook) {
val entity = packet.getEntity(mc.theWorld)

if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
}
}
}
if (packet is S49PacketUpdateEntityNBT) {
val entity = packet.getEntity(mc.theWorld)

if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
}
}
}
}
}
if (packet is S49PacketUpdateEntityNBT) {
val entity = packet.getEntity(mc.theWorld)

if (entity != null && (obStaffs.contains(entity.name) || obStaffs.contains(entity.displayName.unformattedText))) {
if (!detected) {
Client.hud.addNotification(Notification("Staff Detected!", Notification.Type.INFO))
detected = true
"blocksmc" -> {
if (packet is S1DPacketEntityEffect) {
val entity = mc.theWorld.getEntityByID(packet.entityId) ?: return
if (staffs.contains(entity.name) || staffs.contains(entity.displayName.unformattedText)) {
warn(entity.name)
}
}
if (packet is S18PacketEntityTeleport) {
val entity = mc.theWorld.getEntityByID(packet.entityId) ?: return
if (staffs.contains(entity.name) || staffs.contains(entity.displayName.unformattedText)) {
warn(entity.name)
}
}
if (packet is S20PacketEntityProperties) {
val entity = mc.theWorld.getEntityByID(packet.entityId) ?: return
if (staffs.contains(entity.name) || staffs.contains(entity.displayName.unformattedText)) {
warn(entity.name)
}
}
if (packet is S0BPacketAnimation) {
val entity = mc.theWorld.getEntityByID(packet.entityID) ?: return
if (staffs.contains(entity.name) || staffs.contains(entity.displayName.unformattedText)) {
warn(entity.name)
}
}
if (packet is S14PacketEntity) {
val entity = packet.getEntity(mc.theWorld) ?: return
if (staffs.contains(entity.name) || staffs.contains(entity.displayName.unformattedText)) {
warn(entity.name)
}
}
if (packet is S19PacketEntityStatus) {
val entity = packet.getEntity(mc.theWorld) ?: return
if (staffs.contains(entity.name) || staffs.contains(entity.displayName.unformattedText)) {
warn(entity.name)

}
}
if (packet is S19PacketEntityHeadLook) {
val entity = packet.getEntity(mc.theWorld) ?: return
if (staffs.contains(entity.name) || staffs.contains(entity.displayName.unformattedText)) {
warn(entity.name)
}
}
if (packet is S49PacketUpdateEntityNBT) {
val entity = packet.getEntity(mc.theWorld) ?: return
if (staffs.contains(entity.name) || staffs.contains(entity.displayName.unformattedText)) {
warn(entity.name)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,6 @@ class KillAura : Module() {
verusBlocking = false
}

@EventTarget
fun onJump(event: JumpEvent) {
if (movementFix.get().equals("Full") && currentTarget != null)
event.yaw = RotationUtils.serverRotation?.yaw!!
}

/**
* Strafe event
*/
Expand Down
Loading

0 comments on commit 25009e4

Please sign in to comment.