From d9ed920bd5cf488934a18258c51c2b7501d4c71f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:33:37 +0200 Subject: reverted my list -> sequence changes in entity utils as they causing lots of problems --- src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt index 42a5b5583..818f70219 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt @@ -126,10 +126,10 @@ object EntityUtils { ?.value } - inline fun getEntitiesNextToPlayer(radius: Double): Sequence = + inline fun getEntitiesNextToPlayer(radius: Double): List = getEntitiesNearby(LocationUtils.playerLocation(), radius) - inline fun getEntitiesNearby(location: LorenzVec, radius: Double): Sequence = + inline fun getEntitiesNearby(location: LorenzVec, radius: Double): List = getEntities().filter { it.distanceTo(location) < radius } fun EntityLivingBase.isAtFullHealth() = baseMaxHealth == health.toInt() @@ -156,11 +156,13 @@ object EntityUtils { fun EntityEnderman.getBlockInHand(): IBlockState? = heldBlockState - inline fun getEntities(): Sequence = getAllEntities().filterIsInstance() + inline fun getEntities(): List = getAllEntities().filterIsInstance() + inline fun getEntitiesSequence(): Sequence = + Minecraft.getMinecraft()?.theWorld?.loadedEntityList?.asSequence()?.filterIsInstance() ?: emptySequence() - inline fun getEntitiesOrNull(): Sequence? = getAllEntitiesOrNull()?.filterIsInstance() + inline fun getEntitiesOrNull(): List? = getAllEntitiesOrNull()?.filterIsInstance() - fun getAllEntities(): Sequence = getAllEntitiesOrNull() ?: emptySequence() + fun getAllEntities(): List = getAllEntitiesOrNull() ?: emptyList() - fun getAllEntitiesOrNull(): Sequence? = Minecraft.getMinecraft()?.theWorld?.loadedEntityList?.asSequence() + fun getAllEntitiesOrNull(): List? = Minecraft.getMinecraft()?.theWorld?.loadedEntityList } \ No newline at end of file -- cgit