From 9149afde4469c6bba1c5bf3cb7aada4f111222f1 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:43:52 +0200 Subject: added support for all items --- .../rift/area/livingcave/LivingCaveDefenseBlocks.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2') 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(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 -- cgit