Constructor and Description |
---|
Countdown() |
Modifier and Type | Method and Description |
---|---|
TimeUtil.Countdown |
announceAt(long time,
TimeUnit unit) |
TimeUtil.Countdown |
announceAt(TimeUtil.TimePoint point) |
TimeUtil.Countdown |
announceAtRange(long min,
long max,
TimeUnit unit) |
TimeUtil.Countdown |
assignScoreboard(org.bukkit.scoreboard.Scoreboard s)
Assigns a scoreboard to have the objective in the
DisplaySlot.SIDEBAR 's title changed in accordance to the
default format |
TimeUtil.Countdown |
assignScoreboard(org.bukkit.scoreboard.Scoreboard s,
String format)
Assigns a scoreboard to have the objective in the
DisplaySlot.SIDEBAR 's title changed in accordance to the
format given to this specific board. |
String |
getDefaultFormat()
Returns the default format used for all boards
|
TimeUtil.Countdown |
setAnnouncementFormat(String format) |
TimeUtil.Countdown |
setTimeFormat(String format)
Sets the format for the title of the sidebar scoreboard.
|
void |
start(long duration,
Runnable exec)
Starts a countdown timer that will run for as long as the specified
duration argument. |
public void start(long duration, Runnable exec)
duration
argument.duration
- The amount of time in seconds to run the countdownexec
- Task to run when countdown completespublic TimeUtil.Countdown assignScoreboard(org.bukkit.scoreboard.Scoreboard s, String format)
DisplaySlot.SIDEBAR
's title changed in accordance to the
format given to this specific board.s
- The scoreboard to modifyformat
- Optional board-specific format. Can be nullfor info about the
syntax for setting a format string
public TimeUtil.Countdown assignScoreboard(org.bukkit.scoreboard.Scoreboard s)
DisplaySlot.SIDEBAR
's title changed in accordance to the
default formats
- The scoreboard to modifypublic TimeUtil.Countdown setTimeFormat(String format)
%s
and %d
), but
if an additional %s
is supplied it will use the first
%d
for displaying hours and the following for minutes and
seconds. Additionally, %d
should be
the first token in the format string. So in practice:
.* %d .* %s (optional) .* %s .*
(?!.*%[^sd])(?!.*%d.*%d)(?!.*%s.*%s.*%s)
(?!.*%s.*%d)(?=.*%s)(?=.*%d).*
format
- The format for the clockTimeUtil.Countdown
objectpublic TimeUtil.Countdown setAnnouncementFormat(String format)
public TimeUtil.Countdown announceAt(long time, TimeUnit unit)
public TimeUtil.Countdown announceAt(TimeUtil.TimePoint point)
public TimeUtil.Countdown announceAtRange(long min, long max, TimeUnit unit)
public String getDefaultFormat()
Copyright © 2015. All rights reserved.