Class TimerFeature
java.lang.Object
io.github.projectunified.minigamecore.feature.TimerFeature
- All Implemented Interfaces:
Feature,Initializer
The timer feature, which provides duration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the objectlongGet the duration of the timer in millisecondslonggetDuration(TimeUnit unit) Get the duration of the timerbooleanCheck if the timer is not runningbooleanCheck if the timer is runningvoidsetDuration(long duration) Set the duration of the timer in millisecondsvoidsetDuration(long duration, TimeUnit unit) Set the duration of the timerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.projectunified.minigamecore.base.Initializer
init, postInit
-
Constructor Details
-
TimerFeature
public TimerFeature()
-
-
Method Details
-
getDuration
public long getDuration()Get the duration of the timer in milliseconds- Returns:
- the duration
-
setDuration
public void setDuration(long duration) Set the duration of the timer in milliseconds- Parameters:
duration- the duration
-
getDuration
Get the duration of the timer- Parameters:
unit- the time unit of the duration- Returns:
- the duration
-
setDuration
Set the duration of the timer- Parameters:
duration- the durationunit- the time unit of the duration
-
isRunning
public boolean isRunning()Check if the timer is running- Returns:
- true if it is
-
isNotRunning
public boolean isNotRunning()Check if the timer is not running- Returns:
- true if it is
-
clear
public void clear()Description copied from interface:InitializerClear the object- Specified by:
clearin interfaceInitializer
-