@@ -27,7 +27,7 @@ class OSAPI(owner: NativeLuaArchitecture) extends NativeLuaAPI(owner) {
2727 if (lua.getTop > 1 && lua.isNumber(2 )) lua.toNumber(2 )
2828 else ((machine.worldTime + 6000 ) * 60 * 60 ) / 1000.0
2929
30- val dt = GameTimeFormatter .parse (time)
30+ val dt = GameTimeFormatter .5parse (time)
3131 def fmt (format : String ) {
3232 if (format == " *t" ) {
3333 lua.newTable(0 , 8 )
@@ -67,10 +67,11 @@ class OSAPI(owner: NativeLuaArchitecture) extends NativeLuaAPI(owner) {
6767 if (lua.isNoneOrNil(1 )) {
6868 // Game time is in ticks, so that each day has 24000 ticks, meaning
6969 // one hour is game time divided by one thousand. Also, Minecraft
70- // starts days at 6 o'clock, versus the 1 o'clock of timestamps so we
71- // add those five hours. Thus:
72- // timestamp = (time + 5000) * 60[kh] * 60[km] / 1000[s]
73- lua.pushNumber(((machine.worldTime + 5000 ) * 60 * 60 ) / 1000.0 )
70+ // starts days at 6 o'clock; os.time() reflects UTC while os.date()
71+ // reflects the local time zone, but Minecraft has no concept of
72+ // time zones, so this detail can be ignored. Thus:
73+ // timestamp = (time + 6000) * 60[kh] * 60[km] / 1000[s]
74+ lua.pushNumber(((machine.worldTime + 6000 ) * 60 * 60 ) / 1000.0 )
7475 }
7576 else {
7677 def getField (key : String , d : Int ) = {
0 commit comments