aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-22 18:21:02 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-22 18:21:02 +0200
commit84d060a961e892c713eed16dd898c9f7f10fdd40 (patch)
tree0bb68bb3ef6a44020957be7b6eed7433fc337195 /src/main/java/at/hannibal2/skyhanni/features
parentd7deab0722473761b6e8d4c66a03d889f350a685 (diff)
downloadskyhanni-84d060a961e892c713eed16dd898c9f7f10fdd40.tar.gz
skyhanni-84d060a961e892c713eed16dd898c9f7f10fdd40.tar.bz2
skyhanni-84d060a961e892c713eed16dd898c9f7f10fdd40.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/CruxWarnings.kt9
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")