Point pos = point.add(direction.mul(d));
Entity near = point.getWorld().getNearestEntity(pos, player, (int) lastDistanceToEntity);
if (near == null) {
continue;
}
double distance = pos.distance(near.getPhysics().getPosition());
if (distance < lastDistanceToEntity) {
lastDistanceToEntity = distance;
nearest = near;
if (distance < 0.5) {
break;