Repeating Task Runs Once

So I have a scheduler, but it appears to not be firing properly. It seems to only run one time. The following is the scheduler code:

And this is the code its called from:
public static void shield(Player user, int radius, int length, TimeUnit timeUnit) { new ShieldMaintainer(user, timeUnit.toSeconds(length) * 20, radius).runTaskTimer(Star.getStarMain(), 0); }

And finally, the following is the ‘runTaskTimer’ method in my util class:

public synchronized Task runTaskTimer(Object plugin, long period, TimeUnit periodType) { Task task = this.getTaskBuilder().interval(period, periodType).submit(plugin); this.id = task.getUniqueId(); return task; }

I’ve done multiple debugging tests, and it definitely has to do with the amount of times the scheduler is being run, in addition, I know that the ‘times’ variables is at least 100, so I believe it is within the Sponge scheduler system. Am I missing something?

Note:
In addition, the bug began occurring when I upgraded my sponge version to latest

Unless I’m missing something have you just forgotten to call .execute(this) on the task builder?

@simon816
No, you’re not missing anything - I didn’t include that part of the code. The ‘getTaskBuilder’ in the ‘runTaskTimer’ method does do that.

You’ve got .runTaskTimer(Star.getStarMain(), 0); does this mean an interval of 0? Because interval of 0 means run once

Oh… xD
Thanks. In bukkit it meant run as fast as you can (every tick) which i did think was odd

Always read the javadocs on the methods you call as they define what the arguments mean.
To run every tick it’s just .intervalTicks(1)

@simon816
Yeah, I will. Thanks for your help.