Overload reachable with IPlayerContext parameter
This commit is contained in:
		| @@ -127,6 +127,16 @@ public final class RotationUtils { | |||||||
|         return new Vec3d((double) (f1 * f2), (double) f3, (double) (f * f2)); |         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 |      * 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, |      * of the specified block. It first checks if the block center is reachable, and if so, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user