Skip to content

fix look command offthread_repeat math and mounted rotation#2836

Open
BehrRiley wants to merge 3 commits into
DenizenScript:devfrom
BehrRiley:fix/teleport-and-rotation-mechanics
Open

fix look command offthread_repeat math and mounted rotation#2836
BehrRiley wants to merge 3 commits into
DenizenScript:devfrom
BehrRiley:fix/teleport-and-rotation-mechanics

Conversation

@BehrRiley

Copy link
Copy Markdown
Contributor

Summary

This update resolves two distinct issues with the look command:

Problem

  • The offthread_repeat argument applied the total relative yaw and pitch repeatedly instead of splitting them into fractional step increments
  • Paper pull request Teleport rework PaperMC/Paper#13181 deprecated RETAIN_VEHICLE and tightened teleport and rotation restrictions, causing mounted entities and players to fail look updates

Solution

  • fixed the sub-tick step calculation so that offthread_repeat splits the relative yaw and pitch into fractional step increments instead of repeatedly applying the total distance
  • resolved client-side packet drops and Paper vehicle restrictions by temporarily unmounting entities during rotation updates and remounting them properly

Testing, References:

if (entity.isSpawned()) {
if (loc != null) {
NMSHandler.entityHelper.faceLocation(entity.getBukkitEntity(), loc);
org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();

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.

Can clean up FQN for these.


if (loc != null) {
NMSHandler.entityHelper.faceLocation(bukkitEntity, loc);
} else {

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.

Newline after each }.

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.

Can make this else if (entity.isPlayer)) { and shift the below sections over.

- refactor LookCommand `FQN`s and control flow
- format brackets and remove `FQN`s in `LookCommand`
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