A plugin I've created uses a BukkitRunnable .runTaskLater(Plugin plugin, long delay) to run a series of methods after a time specified by the user. The problem is, I would like to be able to modify the delay time while it's counting down but this is not possible solely by using BukkitRunnables. I was advised by a user on Spigot forums to create my own "repeating task system" as he called it. However, since I'm not experienced with Java I have hardly a clue how to go about this, aside from this hint he left me:
I'm not asking to be spoonfed code, so unless you want to do that please just walk me through how to accomplish this.
(On a side note, if anyone could recommend some good books/online courses to learn Java with that would be much appreciated).
I use my own repeating task system in my plugins to solve this and a few other shortcomings of the BukkitRunnable (and by extension Runnable in general), it is fairly easy to implement a task that has a variable delay, simply check if the number of ticks % delay == 0, if so, run the task.
I'm not asking to be spoonfed code, so unless you want to do that please just walk me through how to accomplish this.
(On a side note, if anyone could recommend some good books/online courses to learn Java with that would be much appreciated).
