Overload reachable with IPlayerContext parameter

This commit is contained in:
Brady 2018-12-27 17:15:13 -06:00
parent bebdede33b
commit dffbb8e4c8
No known key found for this signature in database
GPG Key ID: 73A788379A197567

View File

@ -127,6 +127,16 @@ public final class RotationUtils {
return new Vec3d((double) (f1 * f2), (double) f3, (double) (f * f2));
}
/**
* @param ctx Context for the viewing entity
* @param pos The target block position
* @return The optional rotation
* @see #reachable(EntityPlayerSP, BlockPos, double)
*/
public static Optional<Rotation> reachable(IPlayerContext ctx, BlockPos pos) {
return reachable(ctx.player(), pos, ctx.playerController().getBlockReachDistance());
}
/**
* Determines if the specified entity is able to reach the center of any of the sides
* of the specified block. It first checks if the block center is reachable, and if so,