InventivetalentDev / CompactNPCLib

Library to create NPCs
MIT License
22 stars 9 forks source link

Head yaw issue #11

Closed null321-jared closed 8 years ago

null321-jared commented 8 years ago

What steps will reproduce the problem?

  1. Create PlayerNPC
  2. Update yaw to be the ~opposite of what it spawned at.

Video: https://youtu.be/mOLTA_BT7mA

What were you expecting to happen? What happened instead?

I expected the head's pitch to update when the body's did, but instead the head oddly stayed with the same pitch, making it backwards at times.

What version of the plugin are you using? Type /version <Plugin Name>

2.1.0

What Spigot version are you using? Type /version

CraftBukkit version git-Spigot-e4d4710-e1ebe52 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT) Also tested and happens on: CraftBukkit version git-Spigot-7745d45-02d704b (MC: 1.10.2) (Implementing API version 1.10.2-R0.1-SNAPSHOT)

What plugins are you using? Type /plugins

image LocLog is the one that uses this API.

Do you have an error log? Use pastebin.com. If you're not sure, upload your whole server log

No errors.

Did your client crash? Upload errors in .minecraft/logs/latest.log as well

It did not.

Additional information? (Are you using Bungeecord? Did it work in previous versions? etc.)

No bungeecord, it worked in the 1.x.x versions. I tried both setting the entity's location with: Location loc = new Location(world, x, y, z, yaw, pitch); player.getBukkitEntity().teleport(loc); and I also tried following it with player.getNpcEntity().setPitch(pitch); player.getNpcEntity().setYaw(yaw);

InventivetalentDev commented 8 years ago

Yaw seems to be the problem, pitch looks absolutely fine.

InventivetalentDev commented 8 years ago

Please try the latest snapshot (2.1.1-SNAPSHOT), should be fixed there.

null321-jared commented 8 years ago

Okay the following does not affect the head yaw:

Location loc = new Location(world, x, y, z, yaw, pitch);
player.getBukkitEntity().teleport(loc);

But the new method does work: player.setHeadYaw(yaw);

The first thing worked in the old version though, thank you for fixing the issue!