diff --git a/build.properties b/build.properties index 21bc010ca..45512ff0d 100644 --- a/build.properties +++ b/build.properties @@ -2,7 +2,7 @@ minecraft.version=1.10.2 minecraft.mappings=snapshot_20160720 forge.version=12.18.3.2221 -oc.version=1.7.2 +oc.version=1.7.3 ae2.version=rv4-alpha-11 bc.version=7.0.9 diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/sh.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/sh.lua index 8fd2749a6..ec28ad8c7 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/sh.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/sh.lua @@ -15,7 +15,7 @@ if #args == 0 then while true do if has_prompt then while not tty.isAvailable() do - event.pull("term_available", .5) + event.pull(.5, "term_available") end if needs_profile then -- first time run AND interactive needs_profile = nil diff --git a/src/main/resources/assets/opencomputers/loot/openos/init.lua b/src/main/resources/assets/opencomputers/loot/openos/init.lua index 0e7b102a6..ec7a03691 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/init.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/init.lua @@ -1,18 +1,15 @@ do - local loadfile = load([[return function(file) - local pc,cp = computer or package.loaded.computer, component or package.loaded.component - local addr, invoke = pc.getBootAddress(), cp.invoke - local handle, reason = invoke(addr, "open", file) - assert(handle, reason) + local addr, invoke = computer.getBootAddress(), component.invoke + local function loadfile(file) + local handle = assert(invoke(addr, "open", file)) local buffer = "" repeat - local data, reason = invoke(addr, "read", handle, math.huge) - assert(data or not reason, reason) + local data = invoke(addr, "read", handle, math.huge) buffer = buffer .. (data or "") until not data invoke(addr, "close", handle) return load(buffer, "=" .. file, "bt", _G) - end]], "=loadfile", "bt", _G)() + end loadfile("/lib/core/boot.lua")(loadfile) end diff --git a/src/main/resources/assets/opencomputers/loot/openos/lib/core/boot.lua b/src/main/resources/assets/opencomputers/loot/openos/lib/core/boot.lua index 8013be6fe..904b7e905 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/lib/core/boot.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/lib/core/boot.lua @@ -1,7 +1,7 @@ -- called from /init.lua local raw_loadfile = ... -_G._OSVERSION = "OpenOS 1.7.2" +_G._OSVERSION = "OpenOS 1.7.3" local component = component local computer = computer @@ -73,13 +73,9 @@ end status("Booting " .. _OSVERSION .. "...") -- Custom low-level dofile implementation reading from our ROM. -local loadfile = function(file) - status("> " .. file) - return raw_loadfile(file) -end - local function dofile(file) - local program, reason = loadfile(file) + status("> " .. file) + local program, reason = raw_loadfile(file) if program then local result = table.pack(pcall(program)) if result[1] then @@ -112,11 +108,11 @@ do package.loaded.component = component package.loaded.computer = computer package.loaded.unicode = unicode - package.loaded.buffer = assert(loadfile("/lib/buffer.lua"))() - package.loaded.filesystem = assert(loadfile("/lib/filesystem.lua"))() + package.loaded.buffer = dofile("/lib/buffer.lua") + package.loaded.filesystem = dofile("/lib/filesystem.lua") -- Inject the io modules - _G.io = assert(loadfile("/lib/io.lua"))() + _G.io = dofile("/lib/io.lua") end status("Initializing file system...") diff --git a/src/main/resources/assets/opencomputers/lua/bios.lua b/src/main/resources/assets/opencomputers/lua/bios.lua index 5449b963a..e2f1f8f90 100644 --- a/src/main/resources/assets/opencomputers/lua/bios.lua +++ b/src/main/resources/assets/opencomputers/lua/bios.lua @@ -1,61 +1,64 @@ -local component_invoke = component.invoke -function boot_invoke(address, method, ...) - local result = table.pack(pcall(component_invoke, address, method, ...)) - if not result[1] then - return nil, result[2] - else - return table.unpack(result, 2, result.n) - end -end - --- backwards compatibility, may remove later -local eeprom = component.list("eeprom")() -computer.getBootAddress = function() - return boot_invoke(eeprom, "getData") -end -computer.setBootAddress = function(address) - return boot_invoke(eeprom, "setData", address) -end - +local init do - local screen = component.list("screen")() - local gpu = component.list("gpu")() - if gpu and screen then - boot_invoke(gpu, "bind", screen) + local component_invoke = component.invoke + local function boot_invoke(address, method, ...) + local result = table.pack(pcall(component_invoke, address, method, ...)) + if not result[1] then + return nil, result[2] + else + return table.unpack(result, 2, result.n) + end end -end -local function tryLoadFrom(address) - local handle, reason = boot_invoke(address, "open", "/init.lua") - if not handle then - return nil, reason + + -- backwards compatibility, may remove later + local eeprom = component.list("eeprom")() + computer.getBootAddress = function() + return boot_invoke(eeprom, "getData") end - local buffer = "" - repeat - local data, reason = boot_invoke(address, "read", handle, math.huge) - if not data and reason then + computer.setBootAddress = function(address) + return boot_invoke(eeprom, "setData", address) + end + + do + local screen = component.list("screen")() + local gpu = component.list("gpu")() + if gpu and screen then + boot_invoke(gpu, "bind", screen) + end + end + local function tryLoadFrom(address) + local handle, reason = boot_invoke(address, "open", "/init.lua") + if not handle then return nil, reason end - buffer = buffer .. (data or "") - until not data - boot_invoke(address, "close", handle) - return load(buffer, "=init") -end -local init, reason -if computer.getBootAddress() then - init, reason = tryLoadFrom(computer.getBootAddress()) -end -if not init then - computer.setBootAddress() - for address in component.list("filesystem") do - init, reason = tryLoadFrom(address) - if init then - computer.setBootAddress(address) - break + local buffer = "" + repeat + local data, reason = boot_invoke(address, "read", handle, math.huge) + if not data and reason then + return nil, reason + end + buffer = buffer .. (data or "") + until not data + boot_invoke(address, "close", handle) + return load(buffer, "=init") + end + local reason + if computer.getBootAddress() then + init, reason = tryLoadFrom(computer.getBootAddress()) + end + if not init then + computer.setBootAddress() + for address in component.list("filesystem") do + init, reason = tryLoadFrom(address) + if init then + computer.setBootAddress(address) + break + end end end + if not init then + error("no bootable medium found" .. (reason and (": " .. tostring(reason)) or ""), 0) + end + computer.beep(1000, 0.2) end -if not init then - error("no bootable medium found" .. (reason and (": " .. tostring(reason)) or ""), 0) -end -computer.beep(1000, 0.2) -init() \ No newline at end of file +init() diff --git a/src/main/scala/li/cil/oc/client/renderer/PetRenderer.scala b/src/main/scala/li/cil/oc/client/renderer/PetRenderer.scala index 2cf536048..c279df5d5 100644 --- a/src/main/scala/li/cil/oc/client/renderer/PetRenderer.scala +++ b/src/main/scala/li/cil/oc/client/renderer/PetRenderer.scala @@ -34,7 +34,8 @@ object PetRenderer { "23c7ed71-fb13-4abe-abe7-f355e1de6e62" ->(0.3, 0.3, 1.0), // LizzyTheSiren "076541f1-f10a-46de-a127-dfab8adfbb75" ->(0.2, 1.0, 0.1), // vifino "e7e90198-0ccf-4662-a827-192ec8f4419d" ->(0.0, 0.2, 0.6), // Izaya - "f514ee69-7bbb-4e46-9e94-d8176324cec2" ->(0.098, 0.471, 0.784) // Wobbo + "f514ee69-7bbb-4e46-9e94-d8176324cec2" ->(0.098, 0.471, 0.784), // Wobbo + "f812c043-78ba-4324-82ae-e8f05c52ae6e" ->(0.1, 0.8, 0.5) // payonel ) private val petLocations = com.google.common.cache.CacheBuilder.newBuilder().