aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-30 20:03:45 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-30 20:03:45 +0100
commit8b4639f923185f3bbe693805303047ce24eaa238 (patch)
tree8d599603a9e078483c008dd17f19ab5878b565bb /src/main/java/at/hannibal2/skyhanni/utils
parent572e159de71827c5c8a6433de90adba2ebec5c4a (diff)
downloadskyhanni-8b4639f923185f3bbe693805303047ce24eaa238.tar.gz
skyhanni-8b4639f923185f3bbe693805303047ce24eaa238.tar.bz2
skyhanni-8b4639f923185f3bbe693805303047ce24eaa238.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt
index f1d0544a2..7fe6e8efb 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt
@@ -156,10 +156,5 @@ object EntityUtils {
fun Entity.canBeSeen(radius: Double = 150.0) = getLorenzVec().add(y = 0.5).canBeSeen(radius)
- fun getEntityByID(id: Int): Entity? {
- val minecraft = Minecraft.getMinecraft() ?: return null
- val world = minecraft.theWorld ?: return null
- if (minecraft.thePlayer == null) return null
- return world.getEntityByID(id)
- }
+ fun getEntityByID(entityId: Int) = Minecraft.getMinecraft()?.thePlayer?.entityWorld?.getEntityByID(entityId)
}