ThatKawaiiSam / Timers

⏰ Simple Time-keeping library for the Spigot API.

Home Page:https://www.mc-market.org/threads/422074/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timers

Features

  • Fast and efficient.
  • Supports both countdowns and timers.

Code Example

public class ExampleTimer extends Timer {

    public ExampleTimer() {
        super(TimerType.COUNTDOWN, "Example");
        setDuration(TimeUnit.SECONDS.toMillis(10));
    }

    @Override
    public void tick() {
        final int minutes = (int) getMinutes(getRemaining());
        final int seconds = (int) getSeconds(getRemaining());
        Bukkit.broadcastMessage("There is " + minutes + " minutes and " + seconds + " seconds remaining.");
    }

    @Override
    public void onStart() {
        Bukkit.broadcastMessage("The countdown has now started");
    }

    @Override
    public void onComplete() {
        Bukkit.broadcastMessage("The countdown is now complete!");
    }
    
}

Contact

About

⏰ Simple Time-keeping library for the Spigot API.

https://www.mc-market.org/threads/422074/

License:GNU General Public License v3.0


Languages

Language:Java 100.0%