Skip to content

Expose relative parameters to setRotation - #13901

Merged
Warriorrrr merged 14 commits into
PaperMC:mainfrom
Clexus:expose
Jul 26, 2026
Merged

Expose relative parameters to setRotation#13901
Warriorrrr merged 14 commits into
PaperMC:mainfrom
Clexus:expose

Conversation

@Clexus

@Clexus Clexus commented May 22, 2026

Copy link
Copy Markdown
Contributor

More like a QoL update

@Clexus
Clexus requested a review from a team as a code owner May 22, 2026 10:26
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue May 22, 2026

@lynxplay lynxplay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this just be addRotation?
Which, fair addition, I am just not very happy with the method name and parameters, they look to be copying internals one to one and seem very clunky.

//edit:
Might not have said this nicely, there is obviously a different in the method as ServerPlayer makes use of those booleans to send the relative update packet instead. This is purely about naming of the API method.

@Clexus

Clexus commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

Wouldn't this just be addRotation? Which, fair addition, I am just not very happy with the method name and parameters, they look to be copying internals one to one and seem very clunky.

//edit: Might not have said this nicely, there is obviously a different in the method as ServerPlayer makes use of those booleans to send the relative update packet instead. This is purely about naming of the API method.

if renamed to addRotation, the relative parameters will look more confusing, or you mean method like addRotation(yaw, pitch)?
I'd prefer just keep it. I added a note, which may be better

@Warriorrrr

Copy link
Copy Markdown
Member

I could maybe see a use case for being able to set one part of the rotation relative and the other absolute, which wouldn't be possible with just an addRotation(yaw, pitch) method. I'm not immediately a fan of the current proposed method since I dislike having ambiguous boolean parameters in methods, something like a setRotation(Something.relative(2f), Something.absolute(90f)) could fix that.

@Clexus

Clexus commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

I could maybe see a use case for being able to set one part of the rotation relative and the other absolute, which wouldn't be possible with just an addRotation(yaw, pitch) method. I'm not immediately a fan of the current proposed method since I dislike having ambiguous boolean parameters in methods, something like a setRotation(Something.relative(2f), Something.absolute(90f)) could fix that.

I added Angle for that

Comment thread paper-api/src/main/java/io/papermc/paper/math/Angle.java Outdated
Comment thread paper-api/src/main/java/io/papermc/paper/math/AngleImpl.java Outdated
Comment thread paper-api/src/main/java/org/bukkit/entity/Player.java Outdated
@papermc-projects papermc-projects Bot moved this from Awaiting review to Delayed approval in Paper PR Queue Jul 26, 2026
@papermc-projects papermc-projects Bot moved this from Delayed approval to Full approval in Paper PR Queue Jul 26, 2026
@Warriorrrr
Warriorrrr merged commit 05277d4 into PaperMC:main Jul 26, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Full approval to Merged in Paper PR Queue Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

4 participants