diff options
| author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-06-13 22:21:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-13 22:21:50 +0200 |
| commit | 529639fdd0683066eadffe93473a300a2177c008 (patch) | |
| tree | d89cd9aa2c04b4a8a839b9c3b1a56d2058fa7956 /src/main/java/at/hannibal2/skyhanni/events | |
| parent | 151865bca064421d48ec19279b759134fc428443 (diff) | |
| download | skyhanni-529639fdd0683066eadffe93473a300a2177c008.tar.gz skyhanni-529639fdd0683066eadffe93473a300a2177c008.tar.bz2 skyhanni-529639fdd0683066eadffe93473a300a2177c008.zip | |
Backend: for each (#1725)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/events')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/events/RenderEntityOutlineEvent.kt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/RenderEntityOutlineEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RenderEntityOutlineEvent.kt index 85c3211fd..f64dfa27e 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RenderEntityOutlineEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RenderEntityOutlineEvent.kt @@ -4,7 +4,6 @@ import net.minecraft.client.Minecraft import net.minecraft.entity.Entity import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.item.EntityItemFrame -import java.util.function.Consumer class RenderEntityOutlineEvent(theType: Type?, potentialEntities: HashSet<Entity>?) : LorenzEvent() { @@ -97,11 +96,11 @@ class RenderEntityOutlineEvent(theType: Type?, potentialEntities: HashSet<Entity // Only render outlines around non-null entities within the camera frustum entitiesToChooseFrom = HashSet(entities.size) // Only consider entities that aren't invisible armorstands to increase FPS significantly - entities.forEach(Consumer<Entity> { e: Entity? -> - if (e != null && !(e is EntityArmorStand && e.isInvisible()) && e !is EntityItemFrame) { - entitiesToChooseFrom!!.add(e) + for (entity in entities) { + if (!(entity is EntityArmorStand && entity.isInvisible()) && entity !is EntityItemFrame) { + entitiesToChooseFrom!!.add(entity) } - }) + } entitiesToOutline = HashMap(entitiesToChooseFrom!!.size) } |
