diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-03 23:42:13 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-03 23:42:13 +0200 |
commit | 50465e49a4c6f729f72fdbefc88644447bb274e5 (patch) | |
tree | 0eef4a9feb7d97cc0a2170c40b9e26b07704657a | |
parent | bb4d8d809aa576ad70cf91f8c16cea6f083f69fe (diff) | |
download | skyhanni-50465e49a4c6f729f72fdbefc88644447bb274e5.tar.gz skyhanni-50465e49a4c6f729f72fdbefc88644447bb274e5.tar.bz2 skyhanni-50465e49a4c6f729f72fdbefc88644447bb274e5.zip |
fixed the compiler
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt index ef861211e..6400348a8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt @@ -45,20 +45,22 @@ object TrevorSolver { fun findMob() { var canSee = false - val entities = EntityUtils.getAllEntities() - if (entities.isEmpty()) return - for (entity in entities) { + Minecraft.getMinecraft().theWorld ?: return + for (entity in EntityUtils.getAllEntities()) { if (entity is EntityOtherPlayerMP) continue val name = entity.name val entityHealth = if (entity is EntityLivingBase) entity.baseMaxHealth else 0 - currentMob = TrevorMobs.values().firstOrNull {it.mobName.contains(name)} - if (animalHealths.any { it == entityHealth } ) { + currentMob = TrevorMobs.values().firstOrNull { it.mobName.contains(name) } + if (animalHealths.any { it == entityHealth }) { if (currentMob != null) { if (foundID == entity.entityId) { val dist = entity.position.toLorenzVec().distanceToPlayer() if ((currentMob == TrevorMobs.RABBIT || currentMob == TrevorMobs.SHEEP) && mobLocation == CurrentMobArea.OASIS) { println("This is unfortunate") - } else canSee = LocationUtils.canSee(LocationUtils.playerEyeLocation(), entity.position.toLorenzVec().add(0.0, 0.5, 0.0)) && dist < currentMob!!.renderDistance + } else canSee = LocationUtils.canSee( + LocationUtils.playerEyeLocation(), + entity.position.toLorenzVec().add(0.0, 0.5, 0.0) + ) && dist < currentMob!!.renderDistance if (!canSee) { val nameTagEntity = Minecraft.getMinecraft().theWorld.getEntityByID(foundID + 1) |