Class BungeeTimeChecker

java.lang.Object
com.bencodez.advancedcore.bungeeapi.time.BungeeTimeChecker

public abstract class BungeeTimeChecker extends Object
The Class TimeChecker.
  • Constructor Details

    • BungeeTimeChecker

      public BungeeTimeChecker(String timeZone, int timeOffSet, int weekOffSet)
      Instantiates a new bungeecord time checker.
      Parameters:
      timeZone - the time zone
      timeOffSet - the time offset in hours
      weekOffSet - the week offset
  • Method Details

    • debug

      public abstract void debug(String text)
      Debug message.
      Parameters:
      text - the debug text
    • forceChanged

      public void forceChanged(TimeType time)
      Force time change.
      Parameters:
      time - the time type
    • forceChanged

      public void forceChanged(TimeType time, boolean fake, boolean preDate, boolean postDate)
      Force time change.
      Parameters:
      time - the time type
      fake - whether this is a fake change
      preDate - whether to run pre-date actions
      postDate - 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

      public abstract String getPrevMonth()
      Gets the previous month.
      Returns:
      the previous month
    • getPrevWeek

      public abstract int getPrevWeek()
      Gets the previous week.
      Returns:
      the previous week
    • getTime

      public LocalDateTime 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

      public abstract void info(String text)
      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

      public abstract void setPrevMonth(String text)
      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

      public abstract void timeChanged(TimeType type, boolean fake, boolean pre, boolean post)
      Called when time has changed.
      Parameters:
      type - the time type
      fake - whether this is a fake change
      pre - whether this is pre-change
      post - whether this is post-change
    • shutdown

      public void shutdown()
      Shutdown the time checker.
    • update

      public void update()
      Update.
    • warning

      public abstract void warning(String text)
      Warning message.
      Parameters:
      text - the warning text