diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt index f7fdcad4d..3ea9ee4b1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseLocator.kt @@ -36,7 +36,7 @@ object CorpseLocator { */ private val mineshaftCoordsPattern by RepoPattern.pattern( "mineshaft.corpse.coords", - "x: (?<x>-?\\d+), y: (?<y>-?\\d+), z: (?<z>-?\\d+)(?:.+)?" + "x: (?<x>-?\\d+), y: (?<y>-?\\d+), z: (?<z>-?\\d+)(?:.+)?", ) private val sharedWaypoints: MutableList<LorenzVec> = mutableListOf() @@ -53,13 +53,15 @@ object CorpseLocator { val canSee = entity.getLorenzVec().canBeSeen(-1..3) if (canSee) { - ChatUtils.chat("Located a ${corpseType.displayText} and marked its location with a waypoint.") + val article = if (corpseType.displayText == "Umber Corpse") "an" else "a" + ChatUtils.chat("Located $article ${corpseType.displayText} and marked its location with a waypoint.") + MineshaftWaypoints.waypoints.add( MineshaftWaypoint( waypointType = corpseType, location = entity.getLorenzVec().add(y = 1), - isCorpse = true - ) + isCorpse = true, + ), ) } } @@ -70,7 +72,7 @@ object CorpseLocator { .filterNot { corpse -> sharedWaypoints.any { corpse.location.distance(it) <= 5 } } - .filter { it.location.distanceToPlayer() <= 5} + .filter { it.location.distanceToPlayer() <= 5 } .minByOrNull { it.location.distanceToPlayer() } ?: return val (x, y, z) = closestCorpse.location.toDoubleArray().map { it.toInt() } |