Solved Is this right?

Discussion in 'Plugin Development' started by Kakarot798, Mar 7, 2015.

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

    Kakarot798

    Code:
    Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
                    public void run(){
                            for(World worlds: Bukkit.getWorlds()) {
                                worlds.save();
                            }
                        Bukkit.broadcastMessage(pPrefix+"All worlds have been saved. Will save again in 30 minutes.");
                    }
                },0L,36000L);
    I wanted to make a something so my plugin can save all the loaded worlds every 30 minutes, this correct?
     
  2. Offline

    RROD

    scheduleSyncRepeatingTask is deprecated, use BukkitRunnable.runTaskTimer() instead. Basically all you should need to do is change what you are referencing on line 1.

    It takes the arguments:
    Code:
    Plugin plugin, BukkitRunnable task, long delay, long period
    Other than that, seems fine.
     
Thread Status:
Not open for further replies.

Share This Page