β°Timers
Since 1.0.0
import net.codersky.mcutils.time.MCTimeUnit;
import net.codersky.mcutils.time.Timer;
import net.codersky.mcutils.time.TimerTask;
// Let's create a class that starts a game and ends it after 30 minutes.
public class TimeTest {
TimerTask gameTask = null;
public void start(MCPlugin plugin) {
gameTask = new Timer(MCTimeUnit.MINUTES, 30)
.schedule(plugin, () -> endGame());
}
public void endGame() {
// Whatever magical code ends a game.
}
}TimerTask
Last updated