Change world.time to world.totalTime

Fixes the "NAN" bug in LCDClock()
This commit is contained in:
nixnax 2015-01-02 16:22:45 -06:00
parent aae6710427
commit da673ebdcd

View file

@ -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);