@@ -69,9 +69,9 @@ object EntityUtils {
6969 inline fun <reified T : Entity > SafeContext.getFastEntities (
7070 pos : Vec3d ,
7171 distance : Double ,
72- entitiesPtr : MutableList <T >,
72+ pointer : MutableList <T >,
7373 noinline predicate : (T ) -> Boolean = { true },
74- ): List < T > {
74+ ) {
7575 val chunks = ceil(distance / 16 ).toInt()
7676 val sectionX = pos.x.toInt() shr 4
7777 val sectionY = pos.y.toInt() shr 4
@@ -84,14 +84,12 @@ object EntityUtils {
8484 for (y in sectionY - chunks.. sectionY + chunks) {
8585 for (z in sectionZ - chunks.. sectionZ + chunks) {
8686 val section = world.entityManager.cache.findTrackingSection(ChunkSectionPos .asLong(x, y, z)) ? : continue
87- section.collection.filterIsInstanceTo(entitiesPtr ) { entity ->
87+ section.collection.filterIsInstanceTo(pointer ) { entity ->
8888 entity != player && entity.squaredDistanceTo(pos) <= distance * distance && predicate(entity)
8989 }
9090 }
9191 }
9292 }
93-
94- return entitiesPtr
9593 }
9694
9795 /* *
@@ -104,10 +102,10 @@ object EntityUtils {
104102 * @return A list of entities of type [T] within the specified distance from the position without the player.
105103 */
106104 inline fun <reified T : Entity > SafeContext.getEntities (
107- entitiesPtr : MutableList <T >,
105+ pointer : MutableList <T >,
108106 noinline predicate : (T ) -> Boolean = { true }
109107 ) {
110- world.entities.filterIsInstanceTo(entitiesPtr ) { entity ->
108+ world.entities.filterIsInstanceTo(pointer ) { entity ->
111109 entity != player && predicate(entity)
112110 }
113111 }
0 commit comments