From 800679913f3198ce7cc0a06972e02c3c2c8b5054 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 11 Dec 2013 03:16:14 -0600 Subject: [PATCH] Add Location.setDirection(Vector). Adds BUKKIT-4862 This commit adds an additional method to Location to set the direction of facing. Included are a set of unit tests that ensure the consistency of getDirection and setDirection using a set of cardinal directions and arbituary data points. Javadocs were also added to pitch and yaw methods that explain the unit and points of origin. By: Wesley Wolfe --- .../src/main/java/org/bukkit/Location.java | 93 +++++++-- .../test/java/org/bukkit/LocationTest.java | 196 ++++++++++++++++++ 2 files changed, 276 insertions(+), 13 deletions(-) create mode 100644 paper-api/src/test/java/org/bukkit/LocationTest.java diff --git a/paper-api/src/main/java/org/bukkit/Location.java b/paper-api/src/main/java/org/bukkit/Location.java index e3f362fdc9..0f74f6d48b 100644 --- a/paper-api/src/main/java/org/bukkit/Location.java +++ b/paper-api/src/main/java/org/bukkit/Location.java @@ -167,45 +167,79 @@ public class Location implements Cloneable { } /** - * Sets the yaw of this location + * Sets the yaw of this location, measured in degrees. + * + * Increasing yaw values are the equivalent of turning to your + * right-facing, increasing the scale of the next respective axis, and + * decreasing the scale of the previous axis. * - * @param yaw New yaw + * @param yaw new rotation's yaw */ public void setYaw(float yaw) { this.yaw = yaw; } /** - * Gets the yaw of this location + * Gets the yaw of this location, measured in degrees. + * + * Increasing yaw values are the equivalent of turning to your + * right-facing, increasing the scale of the next respective axis, and + * decreasing the scale of the previous axis. * - * @return Yaw + * @return the rotation's yaw */ public float getYaw() { return yaw; } /** - * Sets the pitch of this location + * Sets the pitch of this location, measured in degrees. + *