Solved #runTaskTimer Deprecated?

Discussion in 'Plugin Development' started by MoeMix, Apr 2, 2015.

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

    MoeMix

    Hey guys.. just a simple problem that I can't figure out. Why is this deprecated?
    Code:
    Bukkit.getScheduler().runTaskTimer(MoeSG.getInstance(), new BukkitRunnable(){
    
                @Override
                public void run() {
                    // TODO Auto-generated method stub
                   
                }
               
            }, 20, 20);
    #runTaskTimer is deprecated for some reason what's the alternative?
     
  2. Offline

    nverdier

  3. Offline

    MoeMix

    Oh so from the MyRunnable class itself I call the #runTaskTimer method?
     
  4. Offline

    1Rogue

    It's deprecated to pass a BukkitRunnable to the scheduler. Either pass a normal Runnable or just call the method directly on the BukkitRunnable
     
  5. Offline

    MoeMix

    Alright cool thanks @1Rogue and @nverdier
     
  6. Offline

    nverdier

    @MoeMix Well you just use Bukkit.getScheduler().runTaskTimer...

    EDIT: Ninja'd 2x over, :p
     
  7. Offline

    MoeMix

    Yep, got it :) Thanks again!
     
Thread Status:
Not open for further replies.

Share This Page