Solved Help with code efficiency

Discussion in 'Plugin Development' started by Orange Tabby, Jul 14, 2015.

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

    Orange Tabby

    Is it better to have one repeating task in its own class and call the methods you want repeat or have a repeating task for each thing that needs repeating
    Like this
    Code:
    package me.plugin.loop;
    
    import org.bukkit.Bukkit;
    
    public class loop {
       
        public loop(Plugin plugin) {
           
            Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
               
                public void run() {
                call stuff
                   
                }
            }, 0, 1);
           
        }
    
    }
    
    Thank you [cake].
     
  2. Offline

    mythbusterma

    @Orange Tabby

    It doesn't really matter all that much. Use what leads to the most readable code.
     
  3. Offline

    Orange Tabby

Thread Status:
Not open for further replies.

Share This Page