Merge branch 'master-MC1.10' into master-MC1.12

This commit is contained in:
payonel 2020-05-14 23:54:31 -07:00
commit 194660699f
4 changed files with 20 additions and 7 deletions

View File

@ -31,8 +31,8 @@ if #args == 0 then
elseif command ~= "" then
--luacheck: globals _ENV
local result, reason = sh.execute(_ENV, command)
if not result then
io.stderr:write((reason and tostring(reason) or "unknown error") .. "\n")
if not result and reason then
io.stderr:write(tostring(reason), "\n")
end
end
elseif command == nil then -- false only means the input was interrupted

View File

@ -198,7 +198,7 @@ function sh.execute(env, command, ...)
if type(words) ~= "table" then
return words, reason
elseif #words == 0 then
return true, 0
return true
end
-- MUST be table.pack for non contiguous ...

View File

@ -51,10 +51,14 @@ object ScreenRenderer extends TileEntitySpecialRenderer[Screen] {
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
// on the player's position -> angle relative to screen.
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
}

View File

@ -77,12 +77,21 @@ class Proxy {
api.API.config = Settings.get.config
if (LuaStateFactory.include52) {
api.Machine.add(classOf[NativeLua52Architecture])
}
// Weird JNLua bug identified
// 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) {
api.Machine.add(classOf[NativeLua53Architecture])
}
if (include52) {
api.Machine.add(classOf[NativeLua52Architecture])
}
if (LuaStateFactory.includeLuaJ) {
api.Machine.add(classOf[LuaJLuaArchitecture])
}