Add getRotation to Location (#12799)

This commit is contained in:
David 2025-07-16 21:52:05 +02:00 committed by GitHub
parent 22d80a3b3b
commit a6e0c08fdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -425,6 +425,17 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
return addRotation(rotation.yaw(), rotation.pitch());
}
/**
* Retrieves the rotation of this location.
*
* @return a new {@code Rotation} object
*/
@NotNull
@Contract(value = " -> new", pure = true)
public Rotation getRotation() {
return Rotation.rotation(yaw, pitch);
}
/**
* Subtracts the location by another.
*