Change world.time to world.totalTime
Fixes the "NAN" bug in LCDClock()
This commit is contained in:
parent
aae6710427
commit
da673ebdcd
1 changed files with 2 additions and 2 deletions
|
@ -33,9 +33,9 @@ exports.LCDClock = function(drone, fgColor,bgColor,border) {
|
||||||
var clock = this;
|
var clock = this;
|
||||||
function tick() {
|
function tick() {
|
||||||
var rolloverMins = 24*60;
|
var rolloverMins = 24*60;
|
||||||
var timeOfDayInMins = Math.floor(((world.time + 6000) % 24000) / 16.6667);
|
var timeOfDayInMins = Math.floor(((world.totalTime + 6000) % 24000) / 16.6667);
|
||||||
timeOfDayInMins = timeOfDayInMins % rolloverMins;
|
timeOfDayInMins = timeOfDayInMins % rolloverMins;
|
||||||
console.log('Minecraft time: ' + world.time + ' timeOfDayInMins: ' + timeOfDayInMins);
|
console.log('Minecraft time: ' + world.totalTime + ' timeOfDayInMins: ' + timeOfDayInMins);
|
||||||
clock.update(timeOfDayInMins);
|
clock.update(timeOfDayInMins);
|
||||||
};
|
};
|
||||||
intervalId = setInterval(tick, 800);
|
intervalId = setInterval(tick, 800);
|
||||||
|
|
Reference in a new issue