mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-01-12 10:50:37 +01:00
Readded getMinecraftTime.
This commit is contained in:
parent
3980ebefa1
commit
42391cc4d5
@ -77,3 +77,20 @@ function getMinecraftHead(player,size,completed) {
|
|||||||
completed(resizeImage(head,size));
|
completed(resizeImage(head,size));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMinecraftTime(servertime) {
|
||||||
|
servertime = parseInt(servertime);
|
||||||
|
var day = servertime >= 0 && servertime < 13700;
|
||||||
|
return {
|
||||||
|
servertime: servertime,
|
||||||
|
days: parseInt((servertime+8000) / 24000),
|
||||||
|
|
||||||
|
// Assuming it is day at 8:00
|
||||||
|
hours: (parseInt(servertime / 1000)+8) % 24,
|
||||||
|
minutes: parseInt(((servertime / 1000) % 1) * 60),
|
||||||
|
seconds: parseInt(((((servertime / 1000) % 1) * 60) % 1) * 60),
|
||||||
|
|
||||||
|
day: day,
|
||||||
|
night: !day
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user