Skip to content

Commit 46b11b1

Browse files
authored
Merge pull request #17 from Cezqr/master
Fix pv crash
2 parents deeb0d1 + a6b3bea commit 46b11b1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/pages/Dungeons.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object Dungeons: Pages.PVPage("Dungeons") {
3636
).colorize(15.0)
3737
}",
3838
"§cBlood Mob Kills§7: ${profile.playerStats.bloodMobKills.commas}",
39-
"§7Spirit Pet: ${if (profile.pets.pets.any { it.type == "SPIRIT" && it.tier == "LEGENDARY" }) "§l§2Found!" else "§o§4Missing!"}",
39+
"§7Spirit Pet: ${if (profile.pets.pets.any { it.type == "SPIRIT" && it.tier == "LEGENDARY" }) "§l§2Found!" else "§l§4Missing!"}",
4040
)
4141
}
4242

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/pages/Overview.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ object Overview: Pages.PVPage("Overview") {
8383

8484
private var playerEntity: EntityLivingBase? = null
8585

86-
private val playerX = mainX + mainWidth * 5 / 6
86+
private val playerX = mainX + mainWidth * 5 / 9 - 20
8787

8888
private val textCenterY = ((mainHeight * 0.1) + lineY) / 2
8989

@@ -100,14 +100,16 @@ object Overview: Pages.PVPage("Overview") {
100100

101101
dropDown.draw()
102102

103-
playerEntity?.let { drawPlayerOnScreen(playerX.toDouble(), lineY + mainHeight / 2.0 + 175, 175, Mouse.getX() + 325, Mouse.getY() - 225, it) }
103+
playerEntity?.let { drawPlayerOnScreen(playerX.toDouble(), lineY + mainHeight / 2.0 + 100, 100, Mouse.getX(), Mouse.getY() - 200, it) }
104104
}
105105

106106
override fun mouseClick(x: Int, y: Int, button: Int) {
107107
dropDown.click(mouseX.toInt(), mouseY.toInt(), button)
108108
}
109109

110110
fun setPlayer(player: PlayerInfo) = launch {
111+
mc.theWorld.playerEntities.forEach { it -> if (it.name == player.name) { playerEntity = it; return@launch } }
112+
111113
val gameProfile = mc.sessionService.fillProfileProperties(GameProfile(getDashedUUID(player.uuid), player.name), true)
112114

113115
var playerLocationCape: ResourceLocation? = null

0 commit comments

Comments
 (0)