Delay Plugin

Discussion in 'Plugin Development' started by Mathie, Feb 4, 2016.

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

    Mathie

    Hello

    I have a little problem with my plugin. I'd like to do a countdown to the start of my party. Here is how I do:

    The worry is that it's going too fast. So when the game starts, I only have the one that appears. Otherwise I'm countdown that counts in my console.
    So I set a delay:

    The worry is that when the last player joined the party, he remains hang on "Download the land" until the delay ..
    I do not understand.

    There is another way to make a delay?
    Thank you beforehand :)
     
    Last edited: Feb 5, 2016
  2. Offline

    I Al Istannen

  3. Offline

    Mathie

    Thank you
    But always use Scheduler to make threads on bukkit?
     
    Last edited: Feb 5, 2016
  4. Offline

    I Al Istannen

    @Mathie The Sheduler is the direct way. It's easier to use a BukkitRunnable and you have the benefit to be able to call "cancel()" in it. Making your own Threads (via Thread#start() or similar) is a very bad Idea, as Bukkit isn't thread safe.
     
    Mathie likes this.
  5. Offline

    Mathie

    Thanks !
     
    Last edited: Feb 5, 2016
  6. Offline

    mythbusterma

    @I Al Istannen @Mathie

    There's no reason that you can't use a Thread you've created yourself, you just have to abide by the same programming constructs you use when dealing with something the Bukkit server is running asynchronously.

    That being said, the Bukkit scheduler is a lot more convenient.
     
    I Al Istannen likes this.
Thread Status:
Not open for further replies.

Share This Page