Skip to content

Commit

Permalink
OK
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Apr 27, 2024
1 parent 5929f17 commit 442da07
Show file tree
Hide file tree
Showing 27 changed files with 131 additions and 125 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies {

include "com.viaversion:viaversion:${project.viaversion_version}"
include "com.viaversion:viabackwards:${project.viabackwards_version}"
include "com.viaversion:viarewind-universal:${project.viarewind_version}"
include "com.viaversion:viarewind:${project.viarewind_version}"
include ("net.raphimc:ViaLegacy:${project.vialegacy_version}") {
exclude group: "com.google.code.gson", module: "gson"
}
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ okhttp_version=4.9.1
snake_yml_version=2.2
slf4j_version=2.0.12

viaversion_version=4.9.3
viabackwards_version=4.9.2
viarewind_version=3.0.6
vialoader_version=2.2.12
vialegacy_version=2.2.22-SNAPSHOT
viaversion_version=4.10.1-SNAPSHOT
viabackwards_version=4.10.0
viarewind_version=3.1.0
vialoader_version=2.2.14-SNAPSHOT
vialegacy_version=2.2.23-SNAPSHOT
4 changes: 2 additions & 2 deletions src/main/java/net/aspw/client/Launch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ object Launch {
// Client information
const val CLIENT_BEST = "NightX"
const val CLIENT_FOLDER = "NightX-Client"
const val CLIENT_VERSION = "B108"
const val CLIENT_VERSION = "B109"
const val CLIENT_CHAT = "§c[$CLIENT_BEST] §r"
const val CLIENT_PROTOCOL_RANGE = "1.7.2 to 1.20.4"
const val CLIENT_PROTOCOL_RANGE = "1.7.2 to 1.20.6"

var isStarting = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import net.aspw.client.protocol.api.ProtocolFixer;
import net.aspw.client.utils.AnimationUtils;
import net.aspw.client.utils.MinecraftInstance;
import net.aspw.client.utils.render.RenderUtils;
import net.minecraft.block.material.Material;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.entity.item.EntityBoat;
Expand Down Expand Up @@ -68,10 +67,10 @@ public void onMotion(MotionEvent event) {
delta = 0.085f;

if (shouldAnimation()) {
eyeHeight = AnimationUtils.animate(END_HEIGHT, eyeHeight, RenderUtils.deltaTime * delta);
eyeHeight = AnimationUtils.animate(END_HEIGHT, eyeHeight, 2 * delta);
doingEyeRot = true;
} else if (eyeHeight < START_HEIGHT)
eyeHeight = AnimationUtils.animate(START_HEIGHT, eyeHeight, RenderUtils.deltaTime * delta);
eyeHeight = AnimationUtils.animate(START_HEIGHT, eyeHeight, 2 * delta);

if (eyeHeight >= START_HEIGHT && doingEyeRot)
doingEyeRot = false;
Expand Down
5 changes: 2 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 @@ -12,7 +12,6 @@
import net.aspw.client.utils.AnimationUtils;
import net.aspw.client.utils.MinecraftInstance;
import net.aspw.client.utils.RotationUtils;
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.C08PacketPlayerBlockPlacement;
Expand Down Expand Up @@ -73,9 +72,9 @@ else if (ProtocolFixer.newerThanOrEqualsTo1_14())
else delta = 0.154f;

if (mc.thePlayer.isSneaking())
eyeHeight = AnimationUtils.animate(END_HEIGHT, eyeHeight, RenderUtils.deltaTime * delta);
eyeHeight = AnimationUtils.animate(END_HEIGHT, eyeHeight, 2 * delta);
else if (eyeHeight < START_HEIGHT)
eyeHeight = AnimationUtils.animate(START_HEIGHT, eyeHeight, RenderUtils.deltaTime * delta);
eyeHeight = AnimationUtils.animate(START_HEIGHT, eyeHeight, 2 * delta);

if (!Objects.requireNonNull(Launch.moduleManager.getModule(SilentRotations.class)).getState())
Objects.requireNonNull(Launch.moduleManager.getModule(SilentRotations.class)).setState(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class FriendCommand : Command("friend", arrayOf("friends")) {
val friends = friendsConfig.friends.size
friendsConfig.clearFriends()
Launch.fileManager.saveConfig(friendsConfig)
chat("Removed $friends friend(s).")
chat("Removed $friends friend (s).")
return
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
package net.aspw.client.features.module.impl.combat

import com.viaversion.viarewind.protocol.protocol1_8to1_9.Protocol1_8To1_9
import com.viaversion.viarewind.utils.PacketUtil
import com.viaversion.viaversion.api.Via
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper
import com.viaversion.viaversion.api.type.Type
import net.aspw.client.Launch
import net.aspw.client.event.*
import net.aspw.client.features.module.Module
Expand Down Expand Up @@ -195,7 +190,6 @@ class KillAura : Module() {
"Vanilla",
"ReBlock",
"Perfect",
"1.9+",
"Fake",
"None"
),
Expand Down Expand Up @@ -295,7 +289,7 @@ class KillAura : Module() {
}
}

"vanilla", "1.9+" -> {
"vanilla" -> {
if (mc.thePlayer.isBlocking || canBlock)
startBlocking(target!!, interactAutoBlockValue.get())
}
Expand Down Expand Up @@ -609,7 +603,7 @@ class KillAura : Module() {
// Call attack event
Launch.eventManager.callEvent(AttackEvent(entity))

if (autoBlockModeValue.get().equals("vanilla", true) || autoBlockModeValue.get().equals("1.9+", true)) {
if (autoBlockModeValue.get().equals("vanilla", true)) {
if (blockingStatus && canBlock && endTimer.hasTimePassed(1)) {
blockingStatus = false
PacketUtils.sendPacketNoEvent(
Expand Down Expand Up @@ -793,16 +787,6 @@ class KillAura : Module() {
blockingStatus = true
}

"1.9+" -> {
if (ProtocolFixer.newerThanOrEqualsTo1_9()) {
val useItem =
PacketWrapper.create(29, null, Via.getManager().connectionManager.connections.iterator().next())
useItem.write(Type.VAR_INT, 1)
PacketUtil.sendToServer(useItem, Protocol1_8To1_9::class.java, true, true)
blockingStatus = true
}
}

"fake" -> {
fakeBlock = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class WatchdogGround : SpeedMode("WatchdogGround") {
else MovementUtils.strafe(baseSpeed)
}
} else {
if (mc.thePlayer.hurtTime >= 8)
MovementUtils.strafe(MovementUtils.getSpeed() * 0.75f)
if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) {
mc.thePlayer.motionX *= (1.0002 + 0.0008 * (mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).amplifier + 1))
mc.thePlayer.motionZ *= (1.0002 + 0.0008 * (mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).amplifier + 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,24 @@ import net.aspw.client.features.module.ModuleCategory
import net.aspw.client.features.module.ModuleInfo
import net.aspw.client.features.module.impl.visual.Interface
import net.aspw.client.value.BoolValue
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.Item

@ModuleInfo(name = "MurdererDetector", spacedName = "Murderer Detector", category = ModuleCategory.OTHER)
class MurdererDetector : Module() {
private val chatValue = BoolValue("Chat", true)

var murderer1: EntityPlayer? = null
var murderer2: EntityPlayer? = null
companion object {
var murderers = mutableListOf<EntityLivingBase>()

@JvmStatic
fun isMurderer(entity: EntityLivingBase): Boolean {
if (entity !is EntityPlayer) return false
if (entity in murderers) return true
return false
}
}

// Murderer Items Updated 2024 04/21
private val murdererItems = mutableListOf(
Expand Down Expand Up @@ -65,14 +74,12 @@ class MurdererDetector : Module() {
)

override fun onDisable() {
murderer1 = null
murderer2 = null
murderers.clear()
}

@EventTarget
fun onWorld(event: WorldEvent) {
murderer1 = null
murderer2 = null
murderers.clear()
}

@EventTarget
Expand All @@ -83,24 +90,14 @@ class MurdererDetector : Module() {
"Knife",
ignoreCase = true
) || murdererItems.contains(Item.getIdFromItem(player.heldItem.item)))
&& player !in murderers
) {
if (murderer1 == null) {
if (Launch.moduleManager.getModule(Interface::class.java)?.flagSoundValue!!.get()) {
Launch.tipSoundManager.popSound.asyncPlay(Launch.moduleManager.popSoundPower)
}
if (chatValue.get())
chat("§e" + player.name + "§r is Murderer!")
murderer1 = player
return
}
if (murderer2 == null && player != murderer1) {
if (Launch.moduleManager.getModule(Interface::class.java)?.flagSoundValue!!.get()) {
Launch.tipSoundManager.popSound.asyncPlay(Launch.moduleManager.popSoundPower)
}
if (chatValue.get())
chat("§e" + player.name + "§r is Murderer!")
murderer2 = player
if (Launch.moduleManager.getModule(Interface::class.java)?.flagSoundValue!!.get()) {
Launch.tipSoundManager.popSound.asyncPlay(Launch.moduleManager.popSoundPower)
}
if (chatValue.get())
chat("§e" + player.name + "§r is Murderer!")
murderers.add(player)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class Scaffold : Module() {
private val placeSlowDownValue = BoolValue("Place-SlowDown", false)
private val speedModifierValue = FloatValue("Speed-Multiplier", 0.8f, 0f, 1.4f, "x") { placeSlowDownValue.get() }
private val slowDownValue = BoolValue("SlowDown", false)
private val xzMultiplier = FloatValue("XZ-Multiplier", 0.6f, 0f, 1.1f, "x") { slowDownValue.get() }
private val xzMultiplier = FloatValue("XZ-Multiplier", 0.7f, 0f, 1.2f, "x") { slowDownValue.get() }
private val noSpeedPotValue = BoolValue("NoSpeedPot", false)
private val speedSlowDown = FloatValue("SpeedPot-SlowDown", 0.8f, 0.0f, 1.1f, "x") { noSpeedPotValue.get() }
private val customSpeedValue = BoolValue("CustomSpeed", false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void onRender2D(Render2DEvent event) {
final AntiBots antiBots = Objects.requireNonNull(Launch.moduleManager.getModule(AntiBots.class));
entityLivingBase = (EntityLivingBase) entity;
String entName;
if (murdererDetector.getState() && (entity == murdererDetector.getMurderer1() || entity == murdererDetector.getMurderer2())) {
if (murdererDetector.getState() && MurdererDetector.isMurderer(entityLivingBase)) {
entName = "§c[Murderer] §7- §r" + entityLivingBase.getDisplayName().getFormattedText();
} else if (EntityUtils.isFriend(entity)) {
entName = "§e[Friend] §7- §r" + entityLivingBase.getDisplayName().getFormattedText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Interface : Module() {
if (targetHudValue.get()) {
val xPos = (ScaledResolution(mc).scaledWidth / 2) - 214f + targetHudXPosValue.get()
val yPos = (ScaledResolution(mc).scaledHeight / 2) - 90f + targetHudYPosValue.get()
val font = Fonts.minecraftFont
val font = FontLoaders.SF21
val killAura = Launch.moduleManager.getModule(KillAura::class.java)
val tpAura = Launch.moduleManager.getModule(TPAura::class.java)
val killAuraRecode = Launch.moduleManager.getModule(KillAuraRecode::class.java)
Expand Down Expand Up @@ -200,7 +200,12 @@ class Interface : Module() {
yPos + 36F,
Color(245, healthColor, 1).rgb
)
font.drawStringWithShadow(healthString, xPos + 64.5F, yPos + 27F, Color(245, healthColor, 1).rgb)
Fonts.minecraftFont.drawStringWithShadow(
healthString,
xPos + 64.5F,
yPos + 27F,
Color(245, healthColor, 1).rgb
)

RenderUtils.newDrawRect(xPos - 1, yPos + 3, xPos + 33F, yPos + 37F, Color(0, 0, 0).rgb)

Expand All @@ -211,18 +216,38 @@ class Interface : Module() {
yPos.toInt() + 4
)
else {
font.drawStringWithShadow("No", xPos + 9, yPos + 7F, Color(120, 120, 120).rgb)
font.drawStringWithShadow("Image", xPos + 2, yPos + 16F, Color(120, 120, 120).rgb)
font.drawStringWithShadow("Found", xPos + 1, yPos + 25F, Color(120, 120, 120).rgb)
font.drawStringWithShadow(
"No",
(xPos + 9).toDouble(),
(yPos + 7F).toDouble(),
Color(120, 120, 120).rgb
)
font.drawStringWithShadow(
"Image",
(xPos + 2).toDouble(),
(yPos + 16F).toDouble(),
Color(120, 120, 120).rgb
)
font.drawStringWithShadow(
"Found",
(xPos + 1).toDouble(),
(yPos + 25F).toDouble(),
Color(120, 120, 120).rgb
)
}

updateAnim(entity.health)

font.drawStringWithShadow(entity.name, xPos + 36F, yPos + 4F, Color(255, 255, 255).rgb)
font.drawStringWithShadow(
entity.name,
(xPos + 36F).toDouble(),
(yPos + 4F).toDouble(),
Color(255, 255, 255).rgb
)
font.drawStringWithShadow(
mc.thePlayer.getDistanceToEntity(entity).toInt().toString() + " blocks away",
xPos + 36F,
yPos + 15F,
(xPos + 36F).toDouble(),
(yPos + 15F).toDouble(),
Color(255, 255, 255).rgb
)
} else if (easingHealth != 0F) easingHealth = 0F
Expand Down Expand Up @@ -288,7 +313,7 @@ class Interface : Module() {
}

private fun updateAnim(targetHealth: Float) {
easingHealth += ((targetHealth - easingHealth) / 2.0F.pow(10.0F - targetHudSpeedValue.get())) * RenderUtils.deltaTime
easingHealth += ((targetHealth - easingHealth) / 2.0F.pow(10.0F - targetHudSpeedValue.get())) * 2
}

private fun getModName(mod: Module): String {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.aspw.client.injection.forge.mixins.gui;

import com.google.gson.JsonObject;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.aspw.client.Launch;
import net.aspw.client.auth.account.CrackedAccount;
import net.aspw.client.auth.account.MinecraftAccount;
Expand All @@ -21,7 +22,6 @@
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.Session;
import net.raphimc.vialoader.util.VersionEnum;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -104,7 +104,7 @@ private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {

@Inject(method = "drawScreen", at = @At("RETURN"))
private void drawScreen(CallbackInfo callbackInfo) {
final VersionEnum version = ProtocolBase.getManager().getTargetVersion();
final ProtocolVersion version = ProtocolBase.getManager().getTargetVersion();

Fonts.minecraftFont.drawStringWithShadow(
"§7Username: §d" + mc.getSession().getUsername(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package net.aspw.client.injection.forge.mixins.gui;

import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.aspw.client.features.api.PacketManager;
import net.aspw.client.protocol.ProtocolBase;
import net.aspw.client.utils.MinecraftInstance;
import net.aspw.client.utils.ServerUtils;
import net.aspw.client.visual.font.semi.Fonts;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiIngameMenu;
import net.raphimc.vialoader.util.VersionEnum;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -31,7 +31,7 @@ private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {
@Inject(method = "drawScreen", at = @At("RETURN"))
private void drawScreen(CallbackInfo callbackInfo) {
try {
final VersionEnum version = ProtocolBase.getManager().getTargetVersion();
final ProtocolVersion version = ProtocolBase.getManager().getTargetVersion();

Fonts.minecraftFont.drawStringWithShadow("§7Username: §d" + mc.getSession().getUsername(), 6f, 6f, 0xffffff);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package net.aspw.client.injection.forge.mixins.gui;

import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.aspw.client.protocol.ProtocolBase;
import net.aspw.client.protocol.api.ProtocolSelector;
import net.aspw.client.visual.client.altmanager.GuiAltManager;
import net.aspw.client.visual.font.semi.Fonts;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.raphimc.vialoader.util.VersionEnum;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -27,7 +27,7 @@ private void initGui(CallbackInfo callbackInfo) {

@Inject(method = "drawScreen", at = @At("RETURN"))
private void drawScreen(CallbackInfo callbackInfo) {
final VersionEnum version = ProtocolBase.getManager().getTargetVersion();
final ProtocolVersion version = ProtocolBase.getManager().getTargetVersion();

Fonts.minecraftFont.drawStringWithShadow("§7Username: §d" + mc.getSession().getUsername(), 6f, 6f, 0xffffff);

Expand Down
Loading

0 comments on commit 442da07

Please sign in to comment.