aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-09-29 11:14:10 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-09-29 11:14:10 +0200
commit3569dec0ab32c357eb34cff79c200f379f3d19ce (patch)
treeeb266d940d253964d953cfca5563df9c27e5b0b0 /src/main/java/at/hannibal2/skyhanni
parente70a67bd5f4e0f0ca17bb1dd836a857b03c30cca (diff)
downloadskyhanni-3569dec0ab32c357eb34cff79c200f379f3d19ce.tar.gz
skyhanni-3569dec0ab32c357eb34cff79c200f379f3d19ce.tar.bz2
skyhanni-3569dec0ab32c357eb34cff79c200f379f3d19ce.zip
made path find condition not optional
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/pathfind/NavigationHelper.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt6
5 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt b/src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt
index bd417e5f7..73915c22d 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt
@@ -391,7 +391,7 @@ object IslandGraphs {
color: Color = LorenzColor.WHITE.toColor(),
onFound: () -> Unit = {},
allowRerouting: Boolean = false,
- condition: () -> Boolean = { true },
+ condition: () -> Boolean,
) {
reset()
currentTargetNode = this
@@ -415,7 +415,7 @@ object IslandGraphs {
color: Color = LorenzColor.WHITE.toColor(),
onFound: () -> Unit = {},
showGoalExact: Boolean = false,
- condition: () -> Boolean = { true },
+ condition: () -> Boolean,
) {
reset()
shouldAllowRerouting = false
@@ -428,7 +428,7 @@ object IslandGraphs {
color: Color = LorenzColor.WHITE.toColor(),
onFound: () -> Unit = {},
showGoalExact: Boolean = false,
- condition: () -> Boolean = { true },
+ condition: () -> Boolean,
) {
currentTarget = location
this.label = label
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt
index dbe06fbf9..7a5e726d2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt
@@ -333,7 +333,7 @@ object HoppityEggLocator {
HoppityEggLocations.apiEggLocations[LorenzUtils.skyBlockIsland]?.let {
for ((i, location) in it.values.withIndex()) {
if (i == target) {
- IslandGraphs.pathFind(location, "Hoppity Test")
+ IslandGraphs.pathFind(location, "Hoppity Test", condition = { true })
return
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/pathfind/NavigationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/pathfind/NavigationHelper.kt
index 48719e63e..f3dc20df6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/pathfind/NavigationHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/pathfind/NavigationHelper.kt
@@ -58,13 +58,12 @@ object NavigationHelper {
val distance = distances[node]!!.roundTo(1)
val component = "$name §e$distance".asComponent()
component.onClick {
-// node.pathFind(label = node.name!!, allowRerouting = true)
- node.pathFind(label = name, allowRerouting = true)
+ node.pathFind(label = name, allowRerouting = true, condition = { true })
sendNavigateMessage(name, goBack)
}
val tag = node.tags.first { it in allowedTags }
- val d = "Name: $name\n§7Type: §r${tag.displayName}\n§7Distance: §e$distance blocks\n§eClick to start navigating!"
- component.hover = d.asComponent()
+ val hoverText = "Name: $name\n§7Type: §r${tag.displayName}\n§7Distance: §e$distance blocks\n§eClick to start navigating!"
+ component.hover = hoverText.asComponent()
component
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
index 3fc4e265d..6c34fedda 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
@@ -126,7 +126,7 @@ object SkyHanniDebugsAndTests {
val location = LorenzVec(x, y, z)
testLocation = location
if (args.getOrNull(3) == "pathfind") {
- IslandGraphs.pathFind(location, "/shtestwaypoint", showGoalExact = true)
+ IslandGraphs.pathFind(location, "/shtestwaypoint", showGoalExact = true, condition = { true })
}
ChatUtils.chat("set test waypoint")
}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt b/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt
index 75d8c3ea2..ca65ae87f 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt
@@ -86,13 +86,15 @@ object GraphEditorBugFinder {
}
val closestForeignNode = closestForeignNodes.minBy { it.position.distanceSqToPlayer() }
val closestNodeToForeignNode = closestCluster.minBy { it.position.distanceSq(closestForeignNode.position) }
- closestNodeToForeignNode.pathFind("Graph Editor Bug", Color.RED)
+ closestNodeToForeignNode.pathFind("Graph Editor Bug", Color.RED, condition = { isEnabled() })
}
println("found $bugs bugs!")
this.errorsInWorld = errorsInWorld
if (clusters.size <= 1) {
- errorsInWorld.keys.minByOrNull { it.position.distanceSqToPlayer() }?.pathFind("Graph Editor Bug", Color.RED)
+ errorsInWorld.keys.minByOrNull {
+ it.position.distanceSqToPlayer()
+ }?.pathFind("Graph Editor Bug", Color.RED, condition = { isEnabled() })
}
}