Skip to content

Commit 61e1ccd

Browse files
committed
Merge remote-tracking branch 'origin/master-MC1.7.10' into master-MC1.12
2 parents eb1901d + d1ca1ce commit 61e1ccd

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ forge.version=14.23.5.2860
55

66
mod.name=OpenComputers
77
mod.group=li.cil.oc
8-
mod.version=1.8.8-snapshot
8+
mod.version=1.8.9-snapshot
99

1010
ae2.version=rv6-stable-7
1111
buildcraft.version=7.99.24.8

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Fixes/improvements
22

3+
* [#3621] Fix `os.time()` being off by one hour
34
* [#3682] Add error handling to the `flash` OpenOS program
45
* [#3764] Fix left and right names being swapped in the Rack GUI
56
* [#3779] Fix `os.sleep(0)` causing `too long without yielding` (Ocawesome101)

src/main/resources/assets/opencomputers/loot/openos/lib/core/boot.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- called from /init.lua
22
local raw_loadfile = ...
33

4-
_G._OSVERSION = "OpenOS 1.8.8"
4+
_G._OSVERSION = "OpenOS 1.8.9"
55

66
-- luacheck: globals component computer unicode _OSVERSION
77
local component = component

src/main/scala/li/cil/oc/server/machine/luac/OSAPI.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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) = {

src/main/scala/li/cil/oc/server/machine/luaj/OSAPI.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ class OSAPI(owner: LuaJLuaArchitecture) extends LuaJAPI(owner) {
5151
if (args.isnoneornil(1)) {
5252
// Game time is in ticks, so that each day has 24000 ticks, meaning
5353
// one hour is game time divided by one thousand. Also, Minecraft
54-
// starts days at 6 o'clock, versus the 1 o'clock of timestamps so we
55-
// add those five hours. Thus:
56-
// timestamp = (time + 5000) * 60[kh] * 60[km] / 1000[s]
57-
LuaValue.valueOf((machine.worldTime + 5000) * 60 * 60 / 1000)
54+
// starts days at 6 o'clock; os.time() reflects UTC while os.date()
55+
// reflects the local time zone, but Minecraft has no concept of
56+
// time zones, so this detail can be ignored. Thus:
57+
// timestamp = (time + 6000) * 60[kh] * 60[km] / 1000[s]
58+
LuaValue.valueOf((machine.worldTime + 6000) * 60 * 60 / 1000)
5859
}
5960
else {
6061
val table = args.checktable(1)

0 commit comments

Comments
 (0)