Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class ConfigHandler extends DuskConfig {
@Entry public static boolean showRealTime = false;
@Entry public static boolean showRealTimeSeconds = false;
@Entry public static boolean showDaysPlayedWorld = true;
@Entry public static boolean clockPositionIsLeft = false;
@Entry (min = 1, max = 60) public static int updateInterval = 1;
@Entry public static boolean clockPositionIsLeft = false;
@Entry public static boolean clockPositionIsCenter = false;
@Entry public static boolean clockPositionIsRight = true;
@Entry(min = 0, max = 3000) public static int clockHeightOffset = 5;
Expand Down Expand Up @@ -57,6 +58,9 @@ public static void initConfig() {
configMetaData.put("showDaysPlayedWorld", Arrays.asList(
"Show the days played in the world."
));
configMetaData.put("updateInterval", Arrays.asList(
"Sets the base step at which clock updates"
));
configMetaData.put("clockPositionIsLeft", Arrays.asList(
"Places the GUI clock on the left."
));
Expand Down
10 changes: 8 additions & 2 deletions Common/src/main/java/com/natamus/guiclock/events/GUIEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,14 @@ private static String getGameTime() {
String[] strsplit = stringtime.toString().split("");

int minutes = (int)Math.floor(Double.parseDouble(strsplit[2] + strsplit[3])/100*60);
String sm = minutes + "";
if (minutes < 10) {

float interval = ConfigHandler.updateInterval;
if (interval != 1) {
minutes = (int) (((int)(minutes * (1 / interval))) * interval);
}

String sm = minutes + "";
if (minutes < 10) {
sm = "0" + minutes;
}

Expand Down