1v1 Arena Getting Stuck

Discussion in 'Spigot Plugin Development' started by TimLampen, May 16, 2015.

  1. Hey all,
    So I am creating a 1v1 arena plugin, which everything works perfectly, except one thing.

    On occasion (randomly) players will get stuck in the arena and not able to do commands (since they are blocked by the listener which will be pasted), and when they try to do the only command allowed, it says they aren't in an arena.

    I believe this is because the initiated timer in the start() method in the Arena.class is somehow affecting the other ongoing arenas (players have said that they have received the message before the 10min are up)

    Here are the main classes:
    Arena class:

    ArenaListener class:

    If any more info is needed, feel free to ask, I am stumped on this one and need help

  2. You dont removed the player UUID from p.inarena when the 1v1 ends
  3. upload_2015-5-15_17-39-32.png
  4. What you are doing right now is removing the player's uuid before checking if the player's uuid is in there. You can just use the remove method anyhow because it returns a boolean depending on whether it was removed or not.
    #5 PickNChew, May 16, 2015
    Last edited: May 16, 2015
  5. That would throw a NPE, there are no errors in console
  6. lol. Please try it then get back to me. I gave you a pretty good solution.
  7. Its fine, I solved it. I was not cancelling the runnable once the arena was over.