Repository navigation
Timer
Total time in ticks
Time remaining in ticks
Internal timer name
If the timer is currently running
Map of callbacks by time remaning as trigger
Ticks till next update
Scheduler for update events
Plugin info
Global timer number, used for id in default name
Map of bossbars associated with timer
If the color of the bar should change based on time
Logger for timer
@Deprecated public Timer(int time, String name, Map<Integer,TimeRunnable> callbacks, Boolean showOnlyTime, JavaPlugin plugin)
Constructor for Timer
-
Parameters:
-
time— Starting time -
name— Name of the Timer -
callbacks— Map of ticks remaining to callbacks -
showOnlyTime— Whether or not to show the time as the bossbar title -
plugin— The Plugin making the timer
-
-
Deprecated: Parameter showOnlyTime is deprecated, functionality was moved to
DisplayBarviaTimer.getBar(String)
Constructor for Timer
-
Parameters:
-
time— Starting time -
name— Name of the Timer -
callbacks— Map of ticks remaining to callbacks -
plugin— The Plugin making the timer
-
Constructor for Timer. Timer will be named "default-#"
-
Parameters:
-
time— Starting time -
callbacks— Map of ticks remaining to callbacks -
plugin— The Plugin making the timer
-
@Deprecated public Timer(int time, Map<Integer,TimeRunnable> callbacks, Boolean showOnlyTime, JavaPlugin plugin)
Constructor for Timer
-
Parameters:
-
time— Starting time -
callbacks— Map of ticks remaining to callbacks -
showOnlyTime— Whether or not to show the time as the bossbar title -
plugin— The Plugin making the timer
-
-
Deprecated: Parameter showOnlyTime is deprecated, functionality was moved to
DisplayBarviaTimer.getBar(String)
Return the time remaining in ticks
- Returns: Ticks remaining
Return the time remaining in seconds
- Returns: Seconds remaining (rounding down)
Returns the name of the timer
- Returns: Timer name
Sets the name of the timer
-
Parameters:
name— New name for the timer -
Deprecated: Timer names should not be changed. If you want to change the bosbar title use
Timer.setTitle(String)instead
Sets the title of the main bar
-
Parameters:
title— The new title
Sets the title of one of the bars
-
Parameters:
-
title— The new title -
bar— The bar to change
-
Sets whether or not to automatically change the color of the bar
-
Parameters:
change— Whether or not to automatically change the color of the bar
Resets the Timer: setting time remaining to max time, and reseting bossbar title to name or time
Starts the timer
Adds all players to the main bar
Adds all players to a bar
-
Parameters:
bar— Bar to add them to
Adds a player to the main bar
-
Parameters:
p— Player to add
Adds a player to a bar
-
Parameters:
-
p— Player to add -
bar— Bar to add them to
-
Adds a list of players to the main bar
-
Parameters:
p— List of player to add
Adds a list of players to a bar
-
Parameters:
-
p— List of players to add -
bar— Bar to add them to
-
Removes all players from the main bar
Removes all players from a bar
-
Parameters:
bar— Bar to remove them from
Removes a player from the timer
-
Parameters:
p— Player to remove
Removes a player from the timer
-
Parameters:
-
p— Player to remove -
bar— Bar to remove them from
-
Removes a list of players from the timer
-
Parameters:
p— List of players to remove
Removes a list of players from the timer
-
Parameters:
-
p— List of players to remove -
bar— Bar to remove them from
-
Stops the timer
Updates the timer. INTERNAL USE ONLY
-
Parameters:
dTime— Number of ticks since last update
Sets the time remaining only if the timer is stopped
-
Parameters:
t— New time remaining - Returns: If the time was set
Sets the max time only if the timer is stopped
-
Parameters:
t— New max time - Returns: If the max time was set
Sets the color of the main bar
-
Parameters:
color— New color
Sets the color of the specified bar
-
Parameters:
-
color— New color -
bar— Bar to change
-
Sets the style of the main bar
-
Parameters:
style— New style
Sets the style of the specified bar
-
Parameters:
-
style— New style -
bar— Bar to change
-
Adds a bar to the timer
-
Parameters:
-
key— The key for the bar, used later to access it -
title— The title of the bar
-
Removes a bar from the timer
-
Parameters:
key— The bar to remove
Gets a bar for more fine control
-
Parameters:
bar— Bar name - Returns: Bar
Returns a formated string expressing the time in seconds and minutes
-
Parameters:
ticks— Amount of time in ticks - Returns: Formated time string
Add a callback as specific ticks remaining
-
Parameters:
-
t— Ticks remaining for the callback to be called at -
c— Callback
-
Remove a callback at ticks remaining
-
Parameters:
t— Callback trigger ticks remaining - Returns: The callback returned