aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
index 0077fc870..7133cd3c9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
@@ -69,7 +69,7 @@ class LivingCaveDefenseBlocks {
// read new entity data
val compareLocation = event.location.add(-0.5, -1.5, -0.5)
entity = Minecraft.getMinecraft().theWorld.getEntitiesNearby<EntityOtherPlayerMP>(compareLocation, 2.0)
- .filter { it.name == "Autonull " || it.name == "Autoboots " }
+ .filter { isCorrectMob(it.name) }
.filter { !it.isAtFullHealth() }
.minByOrNull { it.distanceTo(compareLocation) }
}
@@ -83,6 +83,18 @@ class LivingCaveDefenseBlocks {
}
}
+ private fun isCorrectMob(name: String) = when (name) {
+ "Autonull ",
+
+ "Autocap ",
+ "Autochest ",
+ "Autopants ",
+ "Autoboots ",
+ -> true
+
+ else -> false
+ }
+
@SubscribeEvent
fun onBlockChange(event: ServerBlockChangeEvent) {
if (!isEnabled()) return