diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt index 295104caa..39834a6bd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt @@ -21,12 +21,9 @@ class CruxWarnings { private fun checkForShy() { try { if (!(RiftAPI.inRift() || !SkyHanniMod.feature.rift.crux.shyWarning)) return - val world = Minecraft.getMinecraft().theWorld ?: return - val loadedEntityList = world.getLoadedEntityList() ?: return - for (entity in loadedEntityList) { - if (entity.name in shyNames && entity.distanceToPlayer() < 8) { - TitleUtils.sendTitle("§eLook away!", 250) - } + val list = Minecraft.getMinecraft().theWorld?.getLoadedEntityList() ?: return + if (list.any { it.name in shyNames && it.distanceToPlayer() < 8 }) { + TitleUtils.sendTitle("§eLook away!", 250) } } catch (e: Throwable) { CopyErrorCommand.logError(e, "Check for Shy failed") |