Teleport coming from unknown code

Discussion in 'Plugin Development' started by SaxSalute, Jun 27, 2014.

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

    SaxSalute

    Part of my plugin requires it to be able to differentiate between teleports called from my plugin or from another plugin. The way I did it is by creating a custom teleport method that calls the Player.teleport(loc) after it calls a custom teleport event that marks a player for teleportation. This method contains the only instance of Player.teleport(loc) anywhere in my code and this system works flawlessly. However, in circumstances that I can't seem to pinpoint, there are other teleport calls that AREN'T from within this method, often many in rapid succession. The kicker is that the location that they go to is the same location that the special teleports go to, which tells me that this has to be from my plugin and not one of the others. What could be causing all of these stray teleports?
     
  2. Offline

    teej107

    SaxSalute If you need to squash a bug, make sure your plugin is the only one being ran, and add in debug code so you can easily tell what it being executed. It's hard to help you without any code shown.
     
  3. Offline

    ZanderMan9

    If you don't post at least the relevant code, there's no way we can help you.
     
  4. Offline

    AoH_Ruthless

    SaxSalute
    Try a binary search to see which plugin is conflicting.

    ZanderMan9 teej107
    If I am understanding properly, there doesn't seem to be any reason why OP needs to include code.
     
  5. Offline

    SaxSalute

    Posting code would be useless. The part causing this issue spiderwebs through 4 different classes and references way more than that, and the plugin as a whole is nearly 5000 lines. I know the teleport is from within my plugin. To boil my question down further, I'm wondering if there's some purely Bukkit based reason that a single teleport would execute 15+ times if none of the teleport calls are in loops.
     
  6. Offline

    AoH_Ruthless

    SaxSalute
    I still don't understand, is it a plugin conflicting or is it your plugin that is causing this?
     
  7. Offline

    SaxSalute

    AoH_Ruthless It is definitely my plugin. Though I can't trace where it's coming from, my clue to that effect is that all of the stray teleports are to locations that pertain to my plugin.

    Also, teej107, I spent an hour trying to pinpoint the problem with debug code and it's coming from a bizarre location that I can't pinpoint.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  8. Offline

    ZanderMan9

    Perhaps something that your plugin is doing is setting off actions in other plugins somehow? I don't know why that would happen though... But do try running it without ANY other plugins, just to be doubly sure.
     
  9. Offline

    SaxSalute

    I've actually decided on a completely different teleport blocking system to replace the teleport tracking. There are quite a few bugs that spring from this one problem so I'm just going to kill the problem at the source.
     
  10. Offline

    Skye

    My only experience with this was a recursive logic error. Teleporting the player in a PlayerMoveEvent caused the PlayerMoveEvent to fire again, which teleported the player, calling it again... etc. What fixed my problem was including a TeleportCause.Plugin parameter.

    So perhaps teleporting the player is calling a chain of events that lead to your code running again.
     
Thread Status:
Not open for further replies.

Share This Page