Skip to content

Commit

Permalink
fix(utils): fix get mc day method
Browse files Browse the repository at this point in the history
  • Loading branch information
lainio24 committed Jun 22, 2022
1 parent 9981e1f commit fa50ebd
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -8,7 +8,8 @@ public interface MCTimeUtils {
int ticksPerDay = 24000;
int ticksPerHour = 1000;
double ticksPerMinute = 1000d / 60d;
double ticksPerSecond = 1000d / 60d / 60d;
double ticksPerSecond = ticksPerMinute / 60d;
double ticksPerMillisecond = ticksPerSecond / 1000d;

static long[] getTime(Level level) {
return new long[] {level.getDayTime(), level.getGameTime(), System.currentTimeMillis()};
Expand Down Expand Up @@ -36,8 +37,8 @@ static int[] formatDayTime(long rawDayTime) {
return new int[] {day, hour, min, sec};
}

static int getDay(long rawDayTime) {
return (((int) (rawDayTime % 2147483647L)) - ticksAtMidnight + ticksPerDay) / ticksPerDay;
static int getDay(long dayTime) {
return ((int) (dayTime % 2147483647L)) / ticksPerDay;
}

}

0 comments on commit fa50ebd

Please sign in to comment.