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