mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-11 08:16:19 -04:00
Merge branch 'master-MC1.10' into master-MC1.12
This commit is contained in:
commit
194660699f
@ -31,8 +31,8 @@ if #args == 0 then
|
|||||||
elseif command ~= "" then
|
elseif command ~= "" then
|
||||||
--luacheck: globals _ENV
|
--luacheck: globals _ENV
|
||||||
local result, reason = sh.execute(_ENV, command)
|
local result, reason = sh.execute(_ENV, command)
|
||||||
if not result then
|
if not result and reason then
|
||||||
io.stderr:write((reason and tostring(reason) or "unknown error") .. "\n")
|
io.stderr:write(tostring(reason), "\n")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif command == nil then -- false only means the input was interrupted
|
elseif command == nil then -- false only means the input was interrupted
|
||||||
|
@ -198,7 +198,7 @@ function sh.execute(env, command, ...)
|
|||||||
if type(words) ~= "table" then
|
if type(words) ~= "table" then
|
||||||
return words, reason
|
return words, reason
|
||||||
elseif #words == 0 then
|
elseif #words == 0 then
|
||||||
return true, 0
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- MUST be table.pack for non contiguous ...
|
-- MUST be table.pack for non contiguous ...
|
||||||
|
@ -51,10 +51,14 @@ object ScreenRenderer extends TileEntitySpecialRenderer[Screen] {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// y = block.bottom - player.feet
|
||||||
|
// eye is higher, so the y delta should be more negative
|
||||||
|
val eye_delta: Double = y - Minecraft.getMinecraft.thePlayer.getEyeHeight
|
||||||
|
|
||||||
// Crude check whether screen text can be seen by the local player based
|
// Crude check whether screen text can be seen by the local player based
|
||||||
// on the player's position -> angle relative to screen.
|
// on the player's position -> angle relative to screen.
|
||||||
val screenFacing = screen.facing.getOpposite
|
val screenFacing = screen.facing.getOpposite
|
||||||
if (screenFacing.getFrontOffsetX * (x + 0.5) + screenFacing.getFrontOffsetY * (y + 0.5) + screenFacing.getFrontOffsetZ * (z + 0.5) < 0) {
|
if (screenFacing.getFrontOffsetX * (x + 0.5) + screenFacing.getFrontOffsetY * (eye_delta + 0.5) + screenFacing.getFrontOffsetZ * (z + 0.5) < 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,12 +77,21 @@ class Proxy {
|
|||||||
|
|
||||||
api.API.config = Settings.get.config
|
api.API.config = Settings.get.config
|
||||||
|
|
||||||
if (LuaStateFactory.include52) {
|
// Weird JNLua bug identified
|
||||||
api.Machine.add(classOf[NativeLua52Architecture])
|
// When loading JNLua (for either 5.2 or 5.3 lua state) there is a static section that the library loads
|
||||||
}
|
// being static, it loads once regardless of which lua state is loaded first
|
||||||
|
// static { REGISTRYINDEX = lua_registryindex(); }
|
||||||
|
// The problem is that lua_registryindex was removed in 5.3
|
||||||
|
// Thus, if we load JNLua from a lua5.3 state first, this static section fails
|
||||||
|
// We must load 5.2 first, AND we know 5.3 will likely fail to load if 5.2 failed
|
||||||
|
val include52: Boolean = LuaStateFactory.include52
|
||||||
|
// now that JNLua has been initialized from a lua52 state, we are safe to check 5.3
|
||||||
if (LuaStateFactory.include53) {
|
if (LuaStateFactory.include53) {
|
||||||
api.Machine.add(classOf[NativeLua53Architecture])
|
api.Machine.add(classOf[NativeLua53Architecture])
|
||||||
}
|
}
|
||||||
|
if (include52) {
|
||||||
|
api.Machine.add(classOf[NativeLua52Architecture])
|
||||||
|
}
|
||||||
if (LuaStateFactory.includeLuaJ) {
|
if (LuaStateFactory.includeLuaJ) {
|
||||||
api.Machine.add(classOf[LuaJLuaArchitecture])
|
api.Machine.add(classOf[LuaJLuaArchitecture])
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user