Problem with Yaw/Rotation of Player being NaN

Discussion in 'Bukkit Help' started by tustin2121, Oct 17, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    tustin2121

    I'm having a serious problem with getting the rotation of the player. Occasionally, players' yaws will report as NaN, causing a bevy of problems to ensue, the most serious of which is that placed blocks will face rotation 0 (north, technically) no matter the direction you place them from. Other problems include /compass always returning north, map markers pointing in the same direction no matter the player's rotation, and, of course, the /getpos command returning NaN for the Yaw of the player (which is why this thread is titled so).

    The worst part about this is that I can't pinpoint the cause of the problem. It comes and goes seemingly randomly: a staircase that won't place properly one minute will be fine the next, with no change in location. I have a few plugins, including Essentials (which is not causing the problem; I disabled it and it didn't fix anything with block placement). Others are: iChat, PermissionsEx, LWC, EpicZones, PorteCoulissante, Showcase (including the NarrowtuxLib), MyHome, WorldEdit.

    Admittedly I am running a couple RBs behind; my server is running 1185. Is this a known problem that has since been fixed?
     
  2. Offline

    tustin2121

    Upgraded to 1240 and nothing's changed...
     
  3. Offline

    mindless728

    have you tried running the plugins one at a time to see if one or more of them is the cause and then also test the server without any plugins

    as a plugin may be changing some of the player data in a fashion that is not allowed resulting in the NaN's
     
  4. Offline

    tustin2121

    I have yet to do a thorough testing as far as removing EVERY plugin and testing it individually. I was hoping to see if someone knew anything about this bug, or if someone was experiencing the same problem... :/
     
  5. Offline

    Jorabyte

    I've had exactly the problem described above. Initially I was running SMP vanilla with no mods and had the issue repeatedly. I switched to Bukkit for 3.1.2 with no mods and the problem went away completely. Now I've reverted to 1.2.5 because I wanted to run some mods and plugins--the issue is back.

    The most annoying "symptom" is that you can't shoot arrows, throw eggs or snowballs, cast a fishing rod, or "drop" items in a direction. Everything falls at the player's feet.

    I've downloaded the <player>.dat files from the server and used an NBT tool to manually change the yaw to 0 or 90, and it fixes the problem temporarily. This is a frustrating waste of time, and I'm considering doing some plugin development or looking at the source code to see if I can correct it. If anyone knows of a fix, please let me know.
     
  6. Offline

    Jorabyte

    Bump. Still having the problem, although I've tweaked the server and seem to be getting great performance with no lag. I *must* find a solution to this... another problem is RedPower 2 custom blocks (panels, etc.) can't be placed when the yaw orientation is NaN or 0.
     
  7. Offline

    Necrodoom

    since your server is modded, we cant help you, since these mods modify how bukkit works by a large amount.
     
  8. Offline

    Jorabyte

    Well, I was originally having this problem with vanilla Minecraft SMP, no client or server mods. When I switched to the latest CraftBukkit for 3.1.2 the problem didn't recur on the same server; it has only been back using 1.2.5. So I'm wondering if some server-side bug was fixed between 1.2.5 and 1.3.2 that I could perhaps repair with a plugin. I've done some Java development, so I'm looking at making a plugin with an event listener that will reset the server-side player orientation when it goes to NaN or 0. Any help from the Bukkit gurus will be much appreciated.
     
  9. Offline

    Jorabyte

    I just tried using Essentials with /getpos and /tppos including yaw values. /getpos reports yaw as NaN after the problem starts, and a /tppos specifying a yaw position does no good--I teleport but the yaw is not corrected. :'(
     
  10. Offline

    Jorabyte

    Bumpity bump. I've actually written a few different versions of a plugin to catch any time a PlayerMoveEvent tries to set pitch or yaw to NaN. I can tell the plugin loads and definitely see when it goes into effect--but the result is getting jostled about in a jittery fashion and still winding up with a NaN value slipping through.

    I really want to rebuild CraftBukkit as a whole, fixing the glitch in the original code--but I need to be able to build one with Forge built in and I've been unsuccessful with that. If anyone has any ideas, I appreciate the assist.
     
  11. Offline

    Jorabyte

    Ok, it's been some weeks since I worked on this at all, but I finally wrote a plugin that works... kind of. Since my project is so small I decided to PasteBin the four java files that make up the plugin project (besides references to Bukkit and CraftBukkit jars). For the Bukkit gods, I offer that this plugin fixes the pitch and yaw problem permanently by overloading server objects for the player, but the following bugs are evident:
    1. Inventory display does not update properly.
      1. If an item is in the player's hand and they drop it, the item is dropped but still shown in the player's hand.
      2. If an item is picked up, it will go into an inventory slot--but it will be invisible to the user until the inventory slot is clicked.
      3. If an item is stacked on top of another item, the number of items will not be updated until the stack is clicked.
    2. Players are invisible to each other.
    Originally I wanted the cloning to happen on login, but I discovered that event capture was too late. So I created a command to initiate the cloning operation, /cloneme.
    If anyone can figure out what I did wrong, you win a smile. :D Here goes the code to project SafeOrient:

     
  12. Offline

    Jorabyte

    Bump? No thoughts, anybody?
     
  13. Offline

    tustin2121

    My server died (as in, no players) a long time ago, so I stopped caring (and stopped playing minecraft). I made an attempt at catching it like you did, with a plugin that would attempt to "correct" based on what block the player was currently looking at, with moderate success.

    The most I could figure was something was getting messed up based on where my server was located, behind a firewall routed through another computer, simply because it didn't do it to me when I was sitting next to the server on the network. Granted, that's kind of unlikely just given the way protocols work, and I think I was proven wrong at one point maybe, so there's no guarantee that that had anything to do with it.
     
Thread Status:
Not open for further replies.

Share This Page