Class BungeeTimeChecker
java.lang.Object
com.bencodez.advancedcore.bungeeapi.time.BungeeTimeChecker
The Class TimeChecker.
-
Constructor Summary
ConstructorsConstructorDescriptionBungeeTimeChecker(String timeZone, int timeOffSet, int weekOffSet) Instantiates a new bungeecord time checker. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidDebug message.voidforceChanged(TimeType time) Force time change.voidforceChanged(TimeType time, boolean fake, boolean preDate, boolean postDate) Force time change.abstract longGets the last updated time.abstract intGets the previous day.abstract StringGets the previous month.abstract intGets the previous week.getTime()Gets the current time with timezone and offset applied.booleanhasDayChanged(boolean set) Checks if day has changed.booleanhasMonthChanged(boolean set) Checks if month has changed.booleanChecks if time has offset.booleanhasWeekChanged(boolean set) Checks if week has changed.abstract voidInfo message.abstract booleanChecks if time checker is enabled.abstract booleanChecks if time changes should be ignored.voidLoad the time checker timer.abstract voidsetIgnoreTime(boolean ignore) Sets ignore time flag.abstract voidSets the last updated time to now.abstract voidsetPrevDay(int day) Sets the previous day.abstract voidsetPrevMonth(String text) Sets the previous month.abstract voidsetPrevWeek(int week) Sets the previous week.voidshutdown()Shutdown the time checker.abstract voidtimeChanged(TimeType type, boolean fake, boolean pre, boolean post) Called when time has changed.voidupdate()Update.abstract voidWarning message.
-
Constructor Details
-
BungeeTimeChecker
Instantiates a new bungeecord time checker.- Parameters:
timeZone- the time zonetimeOffSet- the time offset in hoursweekOffSet- the week offset
-
-
Method Details
-
debug
Debug message.- Parameters:
text- the debug text
-
forceChanged
Force time change.- Parameters:
time- the time type
-
forceChanged
Force time change.- Parameters:
time- the time typefake- whether this is a fake changepreDate- whether to run pre-date actionspostDate- whether to run post-date actions
-
getLastUpdated
public abstract long getLastUpdated()Gets the last updated time.- Returns:
- the last updated timestamp
-
getPrevDay
public abstract int getPrevDay()Gets the previous day.- Returns:
- the previous day
-
getPrevMonth
Gets the previous month.- Returns:
- the previous month
-
getPrevWeek
public abstract int getPrevWeek()Gets the previous week.- Returns:
- the previous week
-
getTime
Gets the current time with timezone and offset applied.- Returns:
- the current local date time
-
hasDayChanged
public boolean hasDayChanged(boolean set) Checks if day has changed.- Parameters:
set- whether to set the new day- Returns:
- true if day has changed
-
hasMonthChanged
public boolean hasMonthChanged(boolean set) Checks if month has changed.- Parameters:
set- whether to set the new month- Returns:
- true if month has changed
-
hasTimeOffSet
public boolean hasTimeOffSet()Checks if time has offset.- Returns:
- true if time offset is set
-
hasWeekChanged
public boolean hasWeekChanged(boolean set) Checks if week has changed.- Parameters:
set- whether to set the new week- Returns:
- true if week has changed
-
info
Info message.- Parameters:
text- the info text
-
isEnabled
public abstract boolean isEnabled()Checks if time checker is enabled.- Returns:
- true if enabled
-
isIgnoreTime
public abstract boolean isIgnoreTime()Checks if time changes should be ignored.- Returns:
- true if ignoring time
-
loadTimer
public void loadTimer()Load the time checker timer. -
setIgnoreTime
public abstract void setIgnoreTime(boolean ignore) Sets ignore time flag.- Parameters:
ignore- whether to ignore time changes
-
setLastUpdated
public abstract void setLastUpdated()Sets the last updated time to now. -
setPrevDay
public abstract void setPrevDay(int day) Sets the previous day.- Parameters:
day- the day to set
-
setPrevMonth
Sets the previous month.- Parameters:
text- the month to set
-
setPrevWeek
public abstract void setPrevWeek(int week) Sets the previous week.- Parameters:
week- the week to set
-
timeChanged
Called when time has changed.- Parameters:
type- the time typefake- whether this is a fake changepre- whether this is pre-changepost- whether this is post-change
-
shutdown
public void shutdown()Shutdown the time checker. -
update
public void update()Update. -
warning
Warning message.- Parameters:
text- the warning text
-