diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
4 files changed, 11 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java b/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java index 323b2446e..b3021a63f 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java @@ -150,7 +150,7 @@ public class Dungeon { public boolean highlightSkeletonSkull = true; @Expose - @ConfigOption(name = "Croesus Unopened Chest Tracker", desc = "Adds a visual highlight to the Croesus inventory that " + + @ConfigOption(name = "Croesus Chest", desc = "Adds a visual highlight to the Croesus inventory that " + "shows unopened chests.") @ConfigEditorBoolean public boolean croesusUnopenedChestTracker = true; diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt index 83a2abbec..9998edca6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -300,7 +300,7 @@ class DamageIndicatorManager { fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return data = data.editCopy { - EntityUtils.getEntities<EntityLivingBase>().mapNotNull(::checkEntity).forEach { this put it } + EntityUtils.getEntitiesSequence<EntityLivingBase>().mapNotNull(::checkEntity).forEach { this put it } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerHideParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerHideParticles.kt index 58ef50f08..d6ae27f3b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerHideParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerHideParticles.kt @@ -20,7 +20,7 @@ class EndermanSlayerHideParticles { fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return - endermanLocations = EntityUtils.getEntities<EntityEnderman>().map { it.getLorenzVec() }.toList() + endermanLocations = EntityUtils.getEntities<EntityEnderman>().map { it.getLorenzVec() } } @SubscribeEvent 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 <reified T : Entity> getEntitiesNextToPlayer(radius: Double): Sequence<T> = + inline fun <reified T : Entity> getEntitiesNextToPlayer(radius: Double): List<T> = getEntitiesNearby<T>(LocationUtils.playerLocation(), radius) - inline fun <reified T : Entity> getEntitiesNearby(location: LorenzVec, radius: Double): Sequence<T> = + inline fun <reified T : Entity> getEntitiesNearby(location: LorenzVec, radius: Double): List<T> = getEntities<T>().filter { it.distanceTo(location) < radius } fun EntityLivingBase.isAtFullHealth() = baseMaxHealth == health.toInt() @@ -156,11 +156,13 @@ object EntityUtils { fun EntityEnderman.getBlockInHand(): IBlockState? = heldBlockState - inline fun <reified R : Entity> getEntities(): Sequence<R> = getAllEntities().filterIsInstance<R>() + inline fun <reified R : Entity> getEntities(): List<R> = getAllEntities().filterIsInstance<R>() + inline fun <reified R : Entity> getEntitiesSequence(): Sequence<R> = + Minecraft.getMinecraft()?.theWorld?.loadedEntityList?.asSequence()?.filterIsInstance<R>() ?: emptySequence() - inline fun <reified R : Entity> getEntitiesOrNull(): Sequence<R>? = getAllEntitiesOrNull()?.filterIsInstance<R>() + inline fun <reified R : Entity> getEntitiesOrNull(): List<R>? = getAllEntitiesOrNull()?.filterIsInstance<R>() - fun getAllEntities(): Sequence<Entity> = getAllEntitiesOrNull() ?: emptySequence() + fun getAllEntities(): List<Entity> = getAllEntitiesOrNull() ?: emptyList() - fun getAllEntitiesOrNull(): Sequence<Entity>? = Minecraft.getMinecraft()?.theWorld?.loadedEntityList?.asSequence() + fun getAllEntitiesOrNull(): List<Entity>? = Minecraft.getMinecraft()?.theWorld?.loadedEntityList }
\ No newline at end of file |