aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-08 17:42:10 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-08 17:42:10 +0200
commitfd22a19a401c50d103722c7a1694d051bc7cb84d (patch)
tree78bcc97c6e7f62bb7c7b3c11d9a623315fbdcbcf /src/main/java/at/hannibal2/skyhanni/data
parent264dde8e13bc9f5d740276d98ab9288a9ef0ed71 (diff)
downloadskyhanni-fd22a19a401c50d103722c7a1694d051bc7cb84d.tar.gz
skyhanni-fd22a19a401c50d103722c7a1694d051bc7cb84d.tar.bz2
skyhanni-fd22a19a401c50d103722c7a1694d051bc7cb84d.zip
moving current area into test class and code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
index 043ee6442..329b6b1b3 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
@@ -5,7 +5,6 @@ import at.hannibal2.skyhanni.events.*
import at.hannibal2.skyhanni.utils.LocationUtils.isPlayerInside
import at.hannibal2.skyhanni.utils.LorenzLogger
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.TabListData
@@ -19,7 +18,7 @@ class HypixelData {
private val tabListProfilePattern = "§e§lProfile: §r§a(?<profile>.*)".toPattern()
private val westVillageFarmArea = AxisAlignedBB(-54.0, 69.0, -115.0, -40.0, 75.0, -127.0)
private val howlingCaveArea = AxisAlignedBB(-401.0, 50.0, -104.0, -337.0, 90.0, 36.0)
- private val zealotBruiserHideoutFixArea = AxisAlignedBB(-520.0, 66.0, -332.0, -558.0, 85.0, -280.0)
+ private val zealotBruiserHideoutArea = AxisAlignedBB(-520.0, 66.0, -332.0, -558.0, 85.0, -280.0)
companion object {
var hypixelLive = false
@@ -74,24 +73,21 @@ class HypixelData {
}
@SubscribeEvent
- fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) {
- if (LorenzUtils.inSkyBlock && Minecraft.getMinecraft().gameSettings.showDebugInfo) {
- config.debugLocationPos.renderString("Current Area: $skyBlockArea", posLabel = "SkyBlock Area (Debug)")
- }
- }
-
- @SubscribeEvent
fun onTick(event: LorenzTickEvent) {
if (event.isMod(2)) {
if (LorenzUtils.inSkyBlock) {
- skyBlockArea = ScoreboardData.sidebarLinesFormatted
+ val originalLocation = ScoreboardData.sidebarLinesFormatted
.firstOrNull { it.startsWith(" §7⏣ ") || it.startsWith(" §5ф ") }
?.substring(5)?.removeColor()
?: "?"
- if (skyBlockIsland == IslandType.THE_RIFT && westVillageFarmArea.isPlayerInside()) skyBlockArea = "Dreadfarm"
- if (skyBlockIsland == IslandType.THE_PARK && howlingCaveArea.isPlayerInside()) skyBlockArea = "Howling Cave"
- if (skyBlockIsland == IslandType.THE_END && zealotBruiserHideoutFixArea.isPlayerInside()) skyBlockArea = "The End"
+ skyBlockArea = when {
+ skyBlockIsland == IslandType.THE_RIFT && westVillageFarmArea.isPlayerInside() -> "Dreadfarm"
+ skyBlockIsland == IslandType.THE_PARK && howlingCaveArea.isPlayerInside() -> "Howling Cave"
+ skyBlockIsland == IslandType.THE_END && zealotBruiserHideoutArea.isPlayerInside() -> "The End"
+
+ else -> originalLocation
+ }
checkProfileName()
}