Skip to content

Commit

Permalink
TrialChamber
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Mar 21, 2024
1 parent 6a0167d commit 42d17cf
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 77 deletions.
5 changes: 1 addition & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ def viaLibs = [
"com.viaversion:viaversion:${project.viaversion_version}",
"com.viaversion:viabackwards:${project.viabackwards_version}",
"com.viaversion:viarewind-universal:${project.viarewind_version}",
"net.raphimc:ViaLoader:${project.vialoader_version}",
"org.yaml:snakeyaml:${project.snake_yml_version}",
"org.slf4j:slf4j-api:${project.slf4j_version}"
"net.raphimc:ViaLoader:${project.vialoader_version}"
]

dependencies {
Expand All @@ -65,7 +63,6 @@ dependencies {
exclude module: "gson"
exclude module: "launchwrapper"
exclude module: "log4j-core"
exclude module: "slf4j-api"
}

for (final def via in viaLibs) {
Expand Down
5 changes: 1 addition & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@ mixingradle_version = ae2a80e
viaversion_version=4.10.0-24w09a-SNAPSHOT
viabackwards_version=4.10.0-24w09a-SNAPSHOT
viarewind_version=3.0.7-24w09a-SNAPSHOT
vialoader_version=2.2.13-SNAPSHOT

snake_yml_version=2.2
slf4j_version=2.0.9
vialoader_version=2.2.13-SNAPSHOT
17 changes: 11 additions & 6 deletions src/main/java/net/aspw/client/features/api/PacketManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
import net.aspw.client.utils.timer.MSTimer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.*;
import net.minecraft.item.ItemBucketMilk;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemPotion;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;

Expand All @@ -34,6 +31,9 @@ public class PacketManager extends MinecraftInstance implements Listenable {
public static int receivePacketCounts;
private int preSend = 0;
private int preReceive = 0;
public static int lastTpX = 0;
public static int lastTpY = 0;
public static int lastTpZ = 0;

@EventTarget
public void onWorld(WorldEvent event) {
Expand All @@ -55,6 +55,10 @@ public void onUpdate(UpdateEvent event) {
@EventTarget
public void onRender3D(Render3DEvent event) {
if (RotationUtils.targetRotation != null) {
if (Objects.requireNonNull(Launch.moduleManager.getModule(SilentRotations.class)).getBodyTweaks().get()) {
mc.thePlayer.renderYawOffset = RotationUtils.targetRotation.getYaw();
mc.thePlayer.rotationYawHead = RotationUtils.targetRotation.getYaw();
}
mc.thePlayer.prevRenderArmYaw = RotationUtils.targetRotation.getYaw();
mc.thePlayer.prevRenderArmPitch = RotationUtils.targetRotation.getPitch();
mc.thePlayer.renderArmYaw = RotationUtils.targetRotation.getYaw();
Expand Down Expand Up @@ -94,9 +98,6 @@ else if (eyeHeight < START_HEIGHT)
if (!Objects.requireNonNull(Launch.moduleManager.getModule(BrandSpoofer.class)).getState())
Objects.requireNonNull(Launch.moduleManager.getModule(BrandSpoofer.class)).setState(true);

if (Animations.consoleEating.get() && MinecraftInstance.mc.thePlayer.isUsingItem() && MinecraftInstance.mc.thePlayer.getHeldItem() != null && (MinecraftInstance.mc.thePlayer.getHeldItem().getItem() instanceof ItemFood || MinecraftInstance.mc.thePlayer.getHeldItem().getItem() instanceof ItemBucketMilk || MinecraftInstance.mc.thePlayer.getHeldItem().getItem() instanceof ItemPotion))
mc.getItemRenderer().resetEquippedProgress();

if ((Animations.swingAnimValue.get().equals("Smooth") || Animations.swingAnimValue.get().equals("Dash")) && event.getEventState() == EventState.PRE) {
if (mc.thePlayer.swingProgressInt == 1) {
swing = 9;
Expand Down Expand Up @@ -128,6 +129,10 @@ else if (eyeHeight < START_HEIGHT)

@EventTarget
public void onTeleport(TeleportEvent event) {
lastTpX = (int) event.getPosX();
lastTpY = (int) event.getPosY();
lastTpZ = (int) event.getPosZ();

if (RotationUtils.targetRotation != null) {
RotationUtils.targetRotation.setYaw(event.getYaw());
RotationUtils.targetRotation.setPitch(event.getPitch());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,23 @@ class ConfigCommand : Command("config", arrayOf("c")) {

args[1].equals("onlineload", ignoreCase = true) -> {
if (args.size > 2) {
val httpClient: CloseableHttpClient = HttpClients.createDefault()
val request = HttpGet(Launch.CLIENT_CONFIGS + args[2])
val response = httpClient.execute(request)
val entity = response.entity
val content = EntityUtils.toString(entity)
EntityUtils.consume(entity)
response.close()
httpClient.close()
SettingsUtils.executeScript(content)
if (Launch.moduleManager.getModule(Interface::class.java)?.flagSoundValue!!.get()) {
Launch.tipSoundManager.popSound.asyncPlay(Launch.moduleManager.popSoundPower)
try {
val httpClient: CloseableHttpClient = HttpClients.createDefault()
val request = HttpGet(Launch.CLIENT_CONFIGS + args[2])
val response = httpClient.execute(request)
val entity = response.entity
val content = EntityUtils.toString(entity)
EntityUtils.consume(entity)
response.close()
httpClient.close()
SettingsUtils.executeScript(content)
if (Launch.moduleManager.getModule(Interface::class.java)?.flagSoundValue!!.get()) {
Launch.tipSoundManager.popSound.asyncPlay(Launch.moduleManager.popSoundPower)
}
chat("§6Config updated successfully!")
} catch (e: Exception) {
chat("§cAPI Error!")
}
chat("§6Config updated successfully!")
return
}
chatSyntax("config onlineload <name>")
Expand Down Expand Up @@ -173,16 +177,20 @@ class ConfigCommand : Command("config", arrayOf("c")) {
}

args[1].equals("onlinelist", ignoreCase = true) -> {
val httpClient: CloseableHttpClient = HttpClients.createDefault()
val request = HttpGet(Launch.CLIENT_CONFIGLIST)
val response = httpClient.execute(request)
val entity = response.entity
val content = EntityUtils.toString(entity)
EntityUtils.consume(entity)
response.close()
httpClient.close()
chat("§cOnlineConfigs:")
chat(content)
try {
val httpClient: CloseableHttpClient = HttpClients.createDefault()
val request = HttpGet(Launch.CLIENT_CONFIGLIST)
val response = httpClient.execute(request)
val entity = response.entity
val content = EntityUtils.toString(entity)
EntityUtils.consume(entity)
response.close()
httpClient.close()
chat("§cOnlineConfigs:")
chat(content)
} catch (e: Exception) {
chat("§cAPI Error!")
}
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ import net.aspw.client.value.ListValue
import net.aspw.client.visual.font.smooth.FontLoaders
import net.minecraft.block.BlockAir
import net.minecraft.client.gui.ScaledResolution
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.renderer.RenderHelper
import net.minecraft.client.settings.GameSettings
import net.minecraft.client.settings.KeyBinding
import net.minecraft.init.Blocks
import net.minecraft.item.ItemBlock
import net.minecraft.item.ItemStack
import net.minecraft.network.Packet
import net.minecraft.network.play.client.*
import net.minecraft.potion.Potion
Expand Down Expand Up @@ -905,19 +902,6 @@ class Scaffold : Module() {
)
}

private fun renderItemStack(stack: ItemStack, x: Int, y: Int) {
GlStateManager.pushMatrix()
GlStateManager.enableRescaleNormal()
GlStateManager.enableBlend()
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0)
RenderHelper.enableGUIStandardItemLighting()
mc.renderItem.renderItemAndEffectIntoGUI(stack, x, y)
RenderHelper.disableStandardItemLighting()
GlStateManager.disableRescaleNormal()
GlStateManager.disableBlend()
GlStateManager.popMatrix()
}

/**
* Search for placeable block
*
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.movement.Speed
import net.aspw.client.utils.MovementUtils
import net.aspw.client.utils.RotationUtils
import net.aspw.client.value.BoolValue
import net.aspw.client.value.FloatValue
import net.aspw.client.value.ListValue
import net.minecraft.client.settings.GameSettings
import net.minecraft.entity.Entity
Expand All @@ -27,7 +26,6 @@ import kotlin.math.sin

@ModuleInfo(name = "TargetStrafe", spacedName = "Target Strafe", category = ModuleCategory.PLAYER)
class TargetStrafe : Module() {
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 Expand Up @@ -99,7 +97,7 @@ class TargetStrafe : Module() {
.toFloat()
))
} else {
if (mc.thePlayer.getDistanceToEntity(target) <= range.get())
if (mc.thePlayer.getDistanceToEntity(target) <= 2.5f)
MovementUtils.setSpeed(event, moveSpeed, rotYaw, direction.toDouble(), 0.0)
else
MovementUtils.setSpeed(event, moveSpeed, rotYaw, direction.toDouble(), 1.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ class Animations : Module() {
@JvmField
val fankeyBobbing = BoolValue("FankeyBobbing", false)

@JvmField
val consoleEating = BoolValue("ConsoleEating-FirstPerson", true)

@JvmField
val bedrockEating = BoolValue("BedrockEating-ThirdPerson", true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import net.aspw.client.event.EventTarget
import net.aspw.client.event.PacketEvent
import net.aspw.client.event.Render2DEvent
import net.aspw.client.event.TickEvent
import net.aspw.client.features.api.PacketManager
import net.aspw.client.features.module.Module
import net.aspw.client.features.module.ModuleCategory
import net.aspw.client.features.module.ModuleInfo
Expand Down Expand Up @@ -58,7 +57,7 @@ class Interface : Module() {
private val targetHudSpeedValue = FloatValue("TargetHud-AnimationSpeed", 3F, 0F, 6F) { targetHudValue.get() }
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 pingValue = BoolValue("Ping", true)
val noAchievement = BoolValue("No-Achievements", true)
val nof5crossHair = BoolValue("NoF5-Crosshair", true)
val animHotbarValue = BoolValue("Hotbar-Animations", false)
Expand Down Expand Up @@ -236,25 +235,13 @@ class Interface : Module() {
} else if (easingHealth != 0F) easingHealth = 0F
}

if (informationValue.get()) {
if (pingValue.get()) {
val xPos = ScaledResolution(mc).scaledWidth
val yPos = ScaledResolution(mc).scaledHeight

fontRenderer.drawStringWithShadow(
"Ping: " + mc.netHandler.getPlayerInfo(mc.thePlayer.uniqueID).responseTime + "ms",
(xPos - 4f - fontRenderer.getStringWidth("Ping: " + mc.netHandler.getPlayerInfo(mc.thePlayer.uniqueID).responseTime + "ms")).toDouble(),
(yPos - 34f).toDouble(),
Color.WHITE.rgb
)
fontRenderer.drawStringWithShadow(
"Packets Sent: " + PacketManager.sendPacketCounts,
(xPos - 4f - fontRenderer.getStringWidth("Packets Sent: " + PacketManager.sendPacketCounts)).toDouble(),
(yPos - 23f).toDouble(),
Color.WHITE.rgb
)
fontRenderer.drawStringWithShadow(
"Packets Received: " + PacketManager.receivePacketCounts,
(xPos - 4f - fontRenderer.getStringWidth("Packets Received: " + PacketManager.receivePacketCounts)).toDouble(),
(yPos - 12f).toDouble(),
Color.WHITE.rgb
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import net.aspw.client.value.BoolValue
class SilentRotations : Module() {

val customStrafe = BoolValue("CustomStrafing", true)
val bodyTweaks = BoolValue("BodyTweaks", true)

var rotating = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ private void drawScreen(CallbackInfo callbackInfo) {

Fonts.minecraftFont.drawStringWithShadow("§7Packets Sent: §d" + PacketManager.sendPacketCounts, 6f, 36f, 0xffffff);
Fonts.minecraftFont.drawStringWithShadow("§7Packets Received: §d" + PacketManager.receivePacketCounts, 6f, 46f, 0xffffff);

Fonts.minecraftFont.drawStringWithShadow("§7LastTPPos: §dX: " + PacketManager.lastTpX + ", Y: " + PacketManager.lastTpY + ", Z: " + PacketManager.lastTpZ, 6f, 56f, 0xffffff);
} catch (final Exception ignored) {
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/aspw/client/visual/client/GuiMainMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class GuiMainMenu : GuiScreen(), GuiYesNoCallback {
-1
)
FontLoaders.SF20.drawStringWithShadow(
"Every modules are working correctly",
(this.width - 10F - FontLoaders.SF20.getStringWidth("Every modules are working correctly")).toDouble(),
"Every modules, commands are working correctly",
(this.width - 10F - FontLoaders.SF20.getStringWidth("Every modules, commands are working correctly")).toDouble(),
42F.toDouble(),
-1
)
Expand All @@ -126,8 +126,8 @@ class GuiMainMenu : GuiScreen(), GuiYesNoCallback {
-1
)
FontLoaders.SF20.drawStringWithShadow(
"Some modules are not working",
(this.width - 10F - FontLoaders.SF20.getStringWidth("Some modules are not working")).toDouble(),
"Some modules, commands are not working",
(this.width - 10F - FontLoaders.SF20.getStringWidth("Some modules, commands are not working")).toDouble(),
42F.toDouble(),
-1
)
Expand Down

0 comments on commit 42d17cf

Please sign in to comment.