Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API-8] Add direction methods on Entity and Living #2139

Merged
merged 2 commits into from
Jul 1, 2020

Conversation

ItsDoot
Copy link
Member

@ItsDoot ItsDoot commented Jul 1, 2020

This PR adds Entity#getDirection() and Living#getHeadDirection(), analogous to Bukkit's getDirection() methods. This has become a common enough use case that I've added a trick to the Discord bot that shows how to get the direction currently. Therefore, I think it's finally time for Sponge to have the methods builtin.

I'm open to also adding Transform#getDirection(), but unsure if there's much point to it, if you can just do transform.getRotationAsQuaternion().getDirection().

@ItsDoot ItsDoot requested a review from gabizou as a code owner July 1, 2020 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants