location.getChunk() give wrong values?

Discussion in 'Plugin Development' started by Schwarzer Zylinder, Jan 24, 2012.

Thread Status:
Not open for further replies.
  1. Hey,
    I have a plugin where you can setup mobs as guards. On the two events ChunkLoad and ChunkUnload I have to check whether a mobs in the loaded/unloaded chunk, so I used location.getChunk() and compared the X and Z values from the mobs and the events chunks. Always returning false.
    I thought there is something wrong, so on every ChunkLoadEvent I printed out all loaded chunks and my own player chunk, used by player.getLocation().getChunk().
    Used on teleporting far away, so the chunk HAS to be in the list of loaded ones.

    Here's the output (Small part of it): YYYY is the loaded chunk, XXX the player chunk.

    2012-01-24 18:52:44 [INFO] YYYY CraftChunk{x=22z=5}
    2012-01-24 18:52:44 [INFO] XXXXXXX CraftChunk{x=22z=7}
    2012-01-24 18:52:44 [INFO] YYYY CraftChunk{x=22z=6}
    2012-01-24 18:52:44 [INFO] XXXXXXX CraftChunk{x=22z=7}
    2012-01-24 18:52:44 [INFO] YYYY CraftChunk{x=22z=8}
    2012-01-24 18:52:45 [INFO] XXXXXXX CraftChunk{x=22z=7}

    The loaded chunks are in a correct order and as you can see, it jumps over the chunk with x=22 and z = 7. This chunk, where I am in, has never called an ChunkLoadEvent.

    Is this a bug? :eek:
     
  2. Offline

    Don Redhorse

    hmm perhaps you could post a part of the code?
     
  3. There is no error code. Just normal running, except the event isn't called.
     
  4. Offline

    Zacherl

  5. Already tried that, same issue. And I reported it on Jira.
     
Thread Status:
Not open for further replies.

Share This Page