Skip to content

Commit

Permalink
Visual
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Mar 21, 2024
1 parent b26b37f commit 6a0167d
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 586 deletions.
5 changes: 0 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ dependencies {
exclude module: "authlib"
}

include('com.github.TheAltening:TheAltening4j:-SNAPSHOT') {
exclude module: "gson"
}
include 'com.github.TheAltening:TheAlteningAuth4j:-SNAPSHOT'

include 'com.github.ben-manes.caffeine:caffeine:2.9.0'
}

Expand Down
8 changes: 5 additions & 3 deletions src/main/java/net/aspw/client/Launch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import net.aspw.client.features.command.CommandManager
import net.aspw.client.features.module.ModuleManager
import net.aspw.client.features.module.impl.other.BrandSpoofer
import net.aspw.client.features.module.impl.other.ThunderNotifier
import net.aspw.client.features.module.impl.visual.*
import net.aspw.client.features.module.impl.visual.Interface
import net.aspw.client.features.module.impl.visual.MoreParticles
import net.aspw.client.features.module.impl.visual.SilentRotations
import net.aspw.client.features.module.impl.visual.Trajectories
import net.aspw.client.protocol.ProtocolBase
import net.aspw.client.protocol.ProtocolMod
import net.aspw.client.utils.*
Expand All @@ -26,7 +29,7 @@ object Launch {
// Client information
const val CLIENT_BEST = "NightX"
const val CLIENT_FOLDER = "NightX-Client"
const val CLIENT_VERSION = "B99"
const val CLIENT_VERSION = "B100"
const val CLIENT_PROTOCOL_RANGE = "1.8 to 24w09a"
const val CLIENT_WEBSITE = "https://aspw-w.github.io/AspieAPI/NightX"
const val CLIENT_CHAT = "§c$CLIENT_BEST: §r"
Expand Down Expand Up @@ -116,7 +119,6 @@ object Launch {
moduleManager.getModule(SilentRotations::class.java)?.state = true
moduleManager.getModule(BrandSpoofer::class.java)?.state = true
moduleManager.getModule(net.aspw.client.features.module.impl.other.DiscordRPC::class.java)?.state = true
moduleManager.getModule(ItemPhysics::class.java)?.state = true
moduleManager.getModule(ThunderNotifier::class.java)?.state = true
moduleManager.getModule(Trajectories::class.java)?.state = true
moduleManager.getModule(MoreParticles::class.java)?.state = true
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/net/aspw/client/config/configs/ValuesConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.aspw.client.features.api.MacroManager;
import net.aspw.client.features.module.Module;
import net.aspw.client.value.Value;
import net.aspw.client.visual.client.altmanager.menus.GuiTheAltening;

import java.io.*;
import java.util.Iterator;
Expand Down Expand Up @@ -48,12 +47,6 @@ protected void loadConfig() throws IOException {

MacroManager.INSTANCE.addMacro(keyValue.getAsInt(), commandValue.getAsString());
}
} else if (entry.getKey().equalsIgnoreCase("features")) {
} else if (entry.getKey().equalsIgnoreCase("thealtening")) {
final JsonObject jsonValue = (JsonObject) entry.getValue();

if (jsonValue.has("API-Key"))
GuiTheAltening.Companion.setApiKey(jsonValue.get("API-Key").getAsString());
} else {

final Module module = Launch.moduleManager.getModule(entry.getKey());
Expand Down Expand Up @@ -87,9 +80,6 @@ protected void saveConfig() throws IOException {
final JsonObject jsonFeatures = new JsonObject();

jsonObject.add("features", jsonFeatures);
final JsonObject theAlteningObject = new JsonObject();
theAlteningObject.addProperty("API-Key", GuiTheAltening.Companion.getApiKey());
jsonObject.add("thealtening", theAlteningObject);

Launch.moduleManager.getModules().stream().filter(module -> !module.getValues().isEmpty()).forEach(module -> {
final JsonObject jsonModule = new JsonObject();
Expand Down
47 changes: 10 additions & 37 deletions src/main/java/net/aspw/client/features/api/PacketManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.aspw.client.features.module.impl.combat.TPAura;
import net.aspw.client.features.module.impl.other.BrandSpoofer;
import net.aspw.client.features.module.impl.visual.Animations;
import net.aspw.client.features.module.impl.visual.Interface;
import net.aspw.client.features.module.impl.visual.SilentRotations;
import net.aspw.client.protocol.ProtocolBase;
import net.aspw.client.utils.*;
Expand All @@ -20,7 +19,6 @@
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemPotion;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;

import java.util.Objects;
Expand All @@ -30,21 +28,17 @@ public class PacketManager extends MinecraftInstance implements Listenable {
private static final MSTimer packetCountTimer = new MSTimer();
public static int swing;
public static boolean isVisualBlocking = false;
public static int flagTicks;
public static float eyeHeight;
public static float lastEyeHeight;
public static int sendPacketCounts;
public static int receivePacketCounts;
private static boolean flagged = false;
private int preSend = 0;
private int preReceive = 0;

@EventTarget
public void onWorld(WorldEvent event) {
if (Objects.requireNonNull(Launch.moduleManager.getModule(SilentRotations.class)).getState())
RotationUtils.Companion.enableLook();
flagged = false;
flagTicks = 1;
}

@EventTarget
Expand All @@ -60,10 +54,12 @@ public void onUpdate(UpdateEvent event) {

@EventTarget
public void onRender3D(Render3DEvent event) {
mc.thePlayer.prevRenderArmYaw = mc.thePlayer.rotationYaw;
mc.thePlayer.prevRenderArmPitch = mc.thePlayer.rotationPitch;
mc.thePlayer.renderArmYaw = mc.thePlayer.rotationYaw;
mc.thePlayer.renderArmPitch = mc.thePlayer.rotationPitch;
if (RotationUtils.targetRotation != null) {
mc.thePlayer.prevRenderArmYaw = RotationUtils.targetRotation.getYaw();
mc.thePlayer.prevRenderArmPitch = RotationUtils.targetRotation.getPitch();
mc.thePlayer.renderArmYaw = RotationUtils.targetRotation.getYaw();
mc.thePlayer.renderArmPitch = RotationUtils.targetRotation.getPitch();
}
}

@EventTarget
Expand Down Expand Up @@ -132,7 +128,10 @@ else if (eyeHeight < START_HEIGHT)

@EventTarget
public void onTeleport(TeleportEvent event) {
flagged = true;
if (RotationUtils.targetRotation != null) {
RotationUtils.targetRotation.setYaw(event.getYaw());
RotationUtils.targetRotation.setPitch(event.getPitch());
}
}

@EventTarget
Expand All @@ -152,32 +151,6 @@ public void onPacket(PacketEvent event) {
packetCountTimer.reset();
}

if (packet instanceof C03PacketPlayer && flagged) {
if (mc.thePlayer.ticksExisted % 2 == 0)
flagTicks++;
if (flagTicks < 4) {
if (RotationUtils.targetRotation != null) {
event.cancelEvent();
PacketUtils.sendPacketNoEvent(
new C03PacketPlayer.C06PacketPlayerPosLook(
mc.thePlayer.posX,
mc.thePlayer.posY,
mc.thePlayer.posZ,
mc.thePlayer.rotationYaw,
mc.thePlayer.rotationPitch,
mc.thePlayer.onGround
)
);
RotationUtils.Companion.reset();
}
} else {
if (Objects.requireNonNull(Launch.moduleManager.getModule(Interface.class)).getState() && Objects.requireNonNull(Launch.moduleManager.getModule(Interface.class)).getTpDebugValue().get())
ClientUtils.displayChatMessage(Launch.CLIENT_CHAT + "tp");
flagTicks = 1;
flagged = false;
}
}

if (ProtocolBase.getManager().getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_10)) {
if (packet instanceof C08PacketPlayerBlockPlacement) {
((C08PacketPlayerBlockPlacement) packet).facingX = 0.5F;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import net.aspw.client.value.BoolValue
import net.aspw.client.value.FloatValue
import net.aspw.client.value.IntegerValue
import net.aspw.client.value.ListValue
import net.aspw.client.visual.font.semi.Fonts
import net.aspw.client.visual.font.smooth.FontLoaders
import net.minecraft.block.BlockAir
import net.minecraft.client.gui.ScaledResolution
Expand Down Expand Up @@ -662,9 +661,10 @@ class Scaffold : Module() {
faceBlock = true

try {
if (faceBlock)
if (faceBlock) {
place()
else if (slot != mc.thePlayer.inventoryContainer.getSlot(InventoryUtils.findAutoBlockBlock()).slotIndex) {
mc.thePlayer.isSwingInProgress = false
} else if (slot != mc.thePlayer.inventoryContainer.getSlot(InventoryUtils.findAutoBlockBlock()).slotIndex) {
mc.thePlayer.inventory.currentItem = InventoryUtils.findAutoBlockBlock() - 36
mc.playerController.updateController()
}
Expand Down Expand Up @@ -895,25 +895,12 @@ class Scaffold : Module() {
@EventTarget
fun onRender2D(event: Render2DEvent) {
val scaledResolution = ScaledResolution(mc)
val infoWidth2 = Fonts.minecraftFont.getStringWidth("$blocksAmount Blocks")
val xPos = 110
val yPos = 30
val canRenderStack =
slot in 0..8 && mc.thePlayer.inventory.mainInventory[slot] != null && mc.thePlayer.inventory.mainInventory[slot].item != null && mc.thePlayer.inventory.mainInventory[slot].item is ItemBlock
if (canRenderStack) {
GlStateManager.pushMatrix()
renderItemStack(
mc.thePlayer.inventory.mainInventory[slot],
(scaledResolution.scaledWidth / 2 - infoWidth2 + xPos / 2),
(scaledResolution.scaledHeight / 2 + yPos)
)
GlStateManager.popMatrix()
}
GlStateManager.resetColor()
val counter = "$blocksAmount Blocks"
val infoWidth = FontLoaders.SF20.getStringWidth(counter)
FontLoaders.SF20.drawStringWithShadow(
"$blocksAmount Blocks",
(scaledResolution.scaledWidth / 2 - infoWidth2 + (xPos + 40) / 2).toDouble(),
(scaledResolution.scaledHeight / 2 + (yPos + 5)).toDouble(),
counter,
(scaledResolution.scaledWidth / 2 - infoWidth + 21).toDouble(),
(scaledResolution.scaledHeight / 2 - 30).toDouble(),
-0x1111111
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import kotlin.math.sin

@ModuleInfo(name = "TargetStrafe", spacedName = "Target Strafe", category = ModuleCategory.PLAYER)
class TargetStrafe : Module() {
val range = FloatValue("Range", 1.5f, 0.1f, 4.0f, "m") { !behind.get() }
val range = FloatValue("Range", 2.5f, 0f, 5f, "m") { !behind.get() }
private val modeValue = ListValue("KeyMode", arrayOf("Jump", "None"), "Jump")
private val safewalk = BoolValue("SafeWalk", true)
private val behind = BoolValue("Behind", false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import net.aspw.client.features.module.impl.combat.TPAura
import net.aspw.client.protocol.ProtocolBase
import net.aspw.client.utils.Access
import net.aspw.client.utils.AnimationUtils
import net.aspw.client.utils.CooldownHelper
import net.aspw.client.utils.render.ColorUtils
import net.aspw.client.utils.render.RenderUtils
import net.aspw.client.value.BoolValue
Expand Down Expand Up @@ -60,10 +59,8 @@ class Interface : Module() {
private val targetHudXPosValue = FloatValue("TargetHud-XPos", 0F, -300F, 300F) { targetHudValue.get() }
private val targetHudYPosValue = FloatValue("TargetHud-YPos", 0F, -300F, 300F) { targetHudValue.get() }
private val informationValue = BoolValue("Information", true)
private val cooldownValue = BoolValue("Cooldown", true)
val noAchievement = BoolValue("No-Achievements", true)
val nof5crossHair = BoolValue("NoF5-Crosshair", true)
val tpDebugValue = BoolValue("TP-Debug", false)
val animHotbarValue = BoolValue("Hotbar-Animations", false)
private val animHotbarSpeedValue = FloatValue("Hotbar-AnimationSpeed", 0.03F, 0.01F, 0.2F) { animHotbarValue.get() }
val blackHotbarValue = BoolValue("Black-Hotbar", false)
Expand All @@ -73,7 +70,7 @@ class Interface : Module() {
val customFov = BoolValue("CustomFov", false)
val customFovModifier = FloatValue("Fov", 1.4F, 1F, 1.8F) { customFov.get() }
val chatRectValue = BoolValue("ChatRect", true)
val chatAnimationValue = BoolValue("Chat-Animations", true)
val chatAnimationValue = BoolValue("Chat-Animations", false)
val chatAnimationSpeedValue = FloatValue("Chat-AnimationSpeed", 0.06F, 0.01F, 0.5F) { chatAnimationValue.get() }
private val toggleMessageValue = BoolValue("Toggle-Notification", false)
private val toggleSoundValue = ListValue("Toggle-Sound", arrayOf("None", "Default", "Custom"), "None")
Expand Down Expand Up @@ -262,32 +259,6 @@ class Interface : Module() {
Color.WHITE.rgb
)
}

if (cooldownValue.get()) {
val xPos = (ScaledResolution(mc).scaledWidth / 2f) - 130f
val yPos = ScaledResolution(mc).scaledHeight
val progress = CooldownHelper.getAttackCooldownProgress()

RenderUtils.newDrawRect(xPos - 26f, yPos - 13f, xPos + 26f, yPos - 8f, Color(150, 150, 150).rgb)
RenderUtils.newDrawRect(xPos - 26f, yPos - 13f, xPos + 26f, yPos - 8f, Color(0, 0, 0).rgb)

if (progress < 1.0 && !mc.isIntegratedServerRunning) {
RenderUtils.drawRect(xPos - 25f, yPos - 12f, xPos + 25f, yPos - 9f, Color(0, 0, 0, 150).rgb)
RenderUtils.drawRect(
xPos - 25f,
yPos - 12f,
xPos + 25f - 50f * progress.toFloat(),
yPos - 9f,
Color(255, 255, 255, 200).rgb
)
} else RenderUtils.drawRect(
xPos - 25f,
yPos - 12f,
xPos + 25f,
yPos - 9f,
Color(255, 255, 255, 200).rgb
)
}
} catch (_: Exception) {
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package net.aspw.client.injection.forge.mixins.gui;

import com.google.gson.JsonObject;
import com.mojang.authlib.Agent;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
import com.thealtening.AltService;
import com.thealtening.api.TheAltening;
import com.thealtening.api.data.AccountData;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.aspw.client.Launch;
import net.aspw.client.auth.account.CrackedAccount;
Expand All @@ -15,14 +9,12 @@
import net.aspw.client.features.module.impl.visual.Interface;
import net.aspw.client.protocol.ProtocolBase;
import net.aspw.client.protocol.api.ProtocolSelector;
import net.aspw.client.utils.ClientUtils;
import net.aspw.client.utils.ServerUtils;
import net.aspw.client.utils.SessionUtils;
import net.aspw.client.utils.misc.RandomUtils;
import net.aspw.client.visual.client.GuiMainMenu;
import net.aspw.client.visual.client.altmanager.GuiAltManager;
import net.aspw.client.visual.client.altmanager.menus.GuiLoginProgress;
import net.aspw.client.visual.client.altmanager.menus.GuiTheAltening;
import net.aspw.client.visual.font.semi.Fonts;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiDisconnected;
Expand All @@ -36,7 +28,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.net.Proxy;
import java.util.List;
import java.util.Objects;
import java.util.Random;
Expand Down Expand Up @@ -68,28 +59,6 @@ private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {
ServerUtils.connectToLastServer();
break;
case 3:
if (!GuiTheAltening.Companion.getApiKey().isEmpty()) {
final String apiKey = GuiTheAltening.Companion.getApiKey();
final TheAltening theAltening = new TheAltening(apiKey);

try {
final AccountData account = theAltening.getAccountData();
GuiAltManager.Companion.getAltService().switchService(AltService.EnumAltService.THEALTENING);

final YggdrasilUserAuthentication yggdrasilUserAuthentication = new YggdrasilUserAuthentication(new YggdrasilAuthenticationService(Proxy.NO_PROXY, ""), Agent.MINECRAFT);
yggdrasilUserAuthentication.setUsername(account.getToken());
yggdrasilUserAuthentication.setPassword(Launch.CLIENT_BEST);
yggdrasilUserAuthentication.logIn();

mc.session = new Session(yggdrasilUserAuthentication.getSelectedProfile().getName(), yggdrasilUserAuthentication.getSelectedProfile().getId().toString(), yggdrasilUserAuthentication.getAuthenticatedToken(), "mojang");
Launch.eventManager.callEvent(new SessionEvent());
ServerUtils.connectToLastServer();
break;
} catch (final Throwable throwable) {
ClientUtils.getLogger().error("Failed to login into random account from TheAltening.", throwable);
}
}

final List<MinecraftAccount> accounts = Launch.fileManager.accountsConfig.getAccounts();
if (accounts.isEmpty())
break;
Expand Down
Loading

0 comments on commit 6a0167d

Please sign in to comment.