Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4454

Normalize returned entity yaw to prevent confusion

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • Minecraft 1.12.2/1.13.2 vanilla

    • 1.13.2-R0.1-Snapshot, 1.12.2-R0.1-SnapShot(Final Build)
    • Yes

      When changing yaw, the yaw can go negative

       

      It seems like getYaw() does not return the yaw of the player, but the leftover of division by 360 of the total of all yaw changes since join

       

      code used to test: https://hastebin.com/egegecegeg.java

      results: https://www.youtube.com/watch?v=OWkzwgQKKQU

       

      Example:
      1. Player joins server, yaw is 90

      2. Player makes 3 turns right(360 * 3 = 1080)

      90+1080=1170

      1170 % 360 = 90

      getYaw() will return 90

      3. Players makes 5 turns left(-360 * 5 = -1800)

      1170+-1800= -630

      -630 % 360 = -270

      getYaw() will return -270, which should be 90 as that is the yaw the player has

            Unassigned Unassigned
            Ilomiswir Ilomiswir
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: