diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-12 12:43:52 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-12 12:43:52 +0200 |
commit | 9149afde4469c6bba1c5bf3cb7aada4f111222f1 (patch) | |
tree | 793e4e46bf026b51ca38feb9c031ab5d1aa5fefa /src/main | |
parent | 5f038cc72cd3c6535f306bc60492aece362d25d6 (diff) | |
download | skyhanni-9149afde4469c6bba1c5bf3cb7aada4f111222f1.tar.gz skyhanni-9149afde4469c6bba1c5bf3cb7aada4f111222f1.tar.bz2 skyhanni-9149afde4469c6bba1c5bf3cb7aada4f111222f1.zip |
added support for all items
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt | 14 |
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 |