Skip to content

Commit 9ad8e56

Browse files
committed
Fix return type
1 parent 4a5dd07 commit 9ad8e56

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

common/src/main/kotlin/com/lambda/util/combat/Explosion.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ object Explosion {
4747
* @param explosion The explosion to calculate the velocity for.
4848
* @return The velocity of the entities.
4949
*/
50-
fun SafeContext.velocity(explosion: Explosion) =
51-
getFastEntities<LivingEntity>(explosion.position, explosion.power * 2.0, ArrayList())
52-
.associateWith { entity -> velocity(entity, explosion) }
50+
fun SafeContext.velocity(explosion: Explosion): Map<LivingEntity, Vec3d> {
51+
val ref = ArrayList<LivingEntity>()
52+
getFastEntities<LivingEntity>(explosion.position, explosion.power * 2.0, ref)
53+
return ref.associateWith { entity -> velocity(entity, explosion) }
54+
}
5355

5456
/**
5557
* Calculates the velocity of a living entity affected by an explosion.

0 commit comments

Comments
 (0)