mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-08-04 03:27:19 -04:00
fix #3621
This commit is contained in:
parent
5d35d7f9e1
commit
a31f90a088
@ -1,5 +1,6 @@
|
|||||||
## Fixes/improvements
|
## Fixes/improvements
|
||||||
|
|
||||||
|
* [#3621] Fix `os.time()` being off by one hour
|
||||||
* [#3682] Add error handling to the `flash` OpenOS program
|
* [#3682] Add error handling to the `flash` OpenOS program
|
||||||
* [#3764] Fix left and right names being swapped in the Rack GUI
|
* [#3764] Fix left and right names being swapped in the Rack GUI
|
||||||
* [#3779] Fix `os.sleep(0)` causing `too long without yielding` (Ocawesome101)
|
* [#3779] Fix `os.sleep(0)` causing `too long without yielding` (Ocawesome101)
|
||||||
|
@ -67,10 +67,11 @@ class OSAPI(owner: NativeLuaArchitecture) extends NativeLuaAPI(owner) {
|
|||||||
if (lua.isNoneOrNil(1)) {
|
if (lua.isNoneOrNil(1)) {
|
||||||
// Game time is in ticks, so that each day has 24000 ticks, meaning
|
// Game time is in ticks, so that each day has 24000 ticks, meaning
|
||||||
// one hour is game time divided by one thousand. Also, Minecraft
|
// one hour is game time divided by one thousand. Also, Minecraft
|
||||||
// starts days at 6 o'clock, versus the 1 o'clock of timestamps so we
|
// starts days at 6 o'clock; os.time() reflects UTC while os.date()
|
||||||
// add those five hours. Thus:
|
// reflects the local time zone, but Minecraft has no concept of
|
||||||
// timestamp = (time + 5000) * 60[kh] * 60[km] / 1000[s]
|
// time zones, so this detail can be ignored. Thus:
|
||||||
lua.pushNumber(((machine.worldTime + 5000) * 60 * 60) / 1000.0)
|
// timestamp = (time + 6000) * 60[kh] * 60[km] / 1000[s]
|
||||||
|
lua.pushNumber(((machine.worldTime + 6000) * 60 * 60) / 1000.0)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
def getField(key: String, d: Int) = {
|
def getField(key: String, d: Int) = {
|
||||||
|
@ -51,10 +51,11 @@ class OSAPI(owner: LuaJLuaArchitecture) extends LuaJAPI(owner) {
|
|||||||
if (args.isnoneornil(1)) {
|
if (args.isnoneornil(1)) {
|
||||||
// Game time is in ticks, so that each day has 24000 ticks, meaning
|
// Game time is in ticks, so that each day has 24000 ticks, meaning
|
||||||
// one hour is game time divided by one thousand. Also, Minecraft
|
// one hour is game time divided by one thousand. Also, Minecraft
|
||||||
// starts days at 6 o'clock, versus the 1 o'clock of timestamps so we
|
// starts days at 6 o'clock; os.time() reflects UTC while os.date()
|
||||||
// add those five hours. Thus:
|
// reflects the local time zone, but Minecraft has no concept of
|
||||||
// timestamp = (time + 5000) * 60[kh] * 60[km] / 1000[s]
|
// time zones, so this detail can be ignored. Thus:
|
||||||
LuaValue.valueOf((machine.worldTime + 5000) * 60 * 60 / 1000)
|
// timestamp = (time + 6000) * 60[kh] * 60[km] / 1000[s]
|
||||||
|
LuaValue.valueOf((machine.worldTime + 6000) * 60 * 60 / 1000)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val table = args.checktable(1)
|
val table = args.checktable(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user