-
Notifications
You must be signed in to change notification settings - Fork 424
Open
Description
ProjecileUtil#raycast takes a double as its final parameter, currently named maxDistance. However, it is only ever compared to a squared distance. It should probably be renamed to maxSquaredDistance or something that indicates the squared-ness.
I'm using Yarn 1.21.8+build.1, but the mapping is still present in latest (25w35a).
Relevant code (from ProjectileUtil#raycast, 1.21.8):
double d = maxDistance;
// ...
double e = min.squaredDistanceTo(vec3d2);
if (e < d || d == 0.0) { // The only reference to d or maxDistance that's not a comparison with 0 or a set
// ...Descriptor: Lnet/minecraft/entity/projectile/ProjectileUtil;raycast(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Box;Ljava/util/function/Predicate;D)Lnet/minecraft/util/hit/EntityHitResult;
Metadata
Metadata
Assignees
Labels
No labels