Skip to content

Commit

Permalink
API Fix (final)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Aug 28, 2024
1 parent ab3bc6a commit 193adcb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/aspw/client/Launch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object Launch {
// Client information
const val CLIENT_BEST = "NightX"
const val CLIENT_FOLDER = "NightX-Client"
const val CLIENT_VERSION = "B130"
const val CLIENT_VERSION = "B131"
const val CLIENT_CHAT = "§7[§5N§di§3g§bh§6t§aX§7] [§eInfo§7] §r"

var isStarting = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ class SilentRotations : Module() {
RotationUtils.enableLook()

mc.thePlayer.rotationYaw = RotationUtils.targetRotation?.yaw!!
mc.thePlayer.prevRenderYawOffset = mc.thePlayer.prevRotationYaw
mc.thePlayer.prevRotationYawHead = mc.thePlayer.prevRotationYaw
mc.thePlayer.renderYawOffset = mc.thePlayer.rotationYaw
mc.thePlayer.rotationYawHead = mc.thePlayer.rotationYaw
mc.thePlayer.rotationPitch = RotationUtils.targetRotation?.pitch!!
}
}
14 changes: 12 additions & 2 deletions src/main/java/net/aspw/client/utils/APIConnecter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ object APIConnecter {
val fileName = i.split(":")[0]
val picType = i.split(":")[1]
tlsAuthConnectionFixes()
gotImage = ImageIO.read(URL(URLComponent.PICTURES + picType + "/" + fileName + ".png"))
val imageUrl = URL(URLComponent.PICTURES + picType + "/" + fileName + ".png")
val imageRequest = Request.Builder().url(imageUrl).build()
val imageBytes = nameClient.newCall(imageRequest).execute().use { response ->
response.body!!.byteStream().readBytes()
}
gotImage = ImageIO.read(imageBytes.inputStream())
pictures.add(
Triple(
fileName,
Expand Down Expand Up @@ -122,7 +127,12 @@ object APIConnecter {
val uuid = i.split(":")[0]
val cape = i.split(":")[1]
tlsAuthConnectionFixes()
gotCapes = ImageIO.read(URL(URLComponent.DONORS + cape))
val imageUrl = URL(URLComponent.DONORS + cape)
val imageRequest = Request.Builder().url(imageUrl).build()
val imageBytes = nameClient.newCall(imageRequest).execute().use { response ->
response.body!!.byteStream().readBytes()
}
gotCapes = ImageIO.read(imageBytes.inputStream())
donorCapeLocations.add(
Pair(
uuid,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/aspw/client/utils/URLComponent.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.aspw.client.utils

object URLComponent {
const val WEBSITE = "https://aspw-w.github.io/NightX"
const val WEBSITE = "https://nattogreatapi.pages.dev/NightX"
const val STATUS = "$WEBSITE/database/data.txt"
const val STAFFS = "$WEBSITE/database/staffs.txt"
const val CHANGELOGS = "$WEBSITE/database/changelogs.txt"
Expand Down

0 comments on commit 193adcb

Please sign in to comment.