Class TimeUtils
java.lang.Object
com.storytimeproductions.stweaks.util.TimeUtils
A utility class for time-related functions in the plugin.
This class provides methods for calculating playtime multipliers based on the current day of the week. Specifically, it checks if today is a weekend (Saturday or Sunday) and applies a weekend multiplier.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]
breakdownSeconds
(double totalSeconds) Breaks down a total number of seconds into hours, minutes, and seconds.static double
Retrieves the multiplier for the current day.
-
Constructor Details
-
TimeUtils
public TimeUtils()
-
-
Method Details
-
getTodayMultiplier
public static double getTodayMultiplier()Retrieves the multiplier for the current day.This method checks if the current day is a weekend (Saturday or Sunday). If it is, it returns the weekend multiplier configured in the plugin settings. Otherwise, it returns a default multiplier of 1.0 (no multiplier).
- Returns:
- The multiplier for the current day based on the day of the week.
-
breakdownSeconds
public static int[] breakdownSeconds(double totalSeconds) Breaks down a total number of seconds into hours, minutes, and seconds.This method takes a double representing total seconds and converts it into an array of three integers: hours, minutes, and seconds.
- Parameters:
totalSeconds
- The total number of seconds to break down.- Returns:
- An array containing the breakdown of hours, minutes, and seconds.
-