mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-29 07:51:12 -04:00
Merge branch 'master' of github.com:MightyPirates/OpenComputers into MC1.7
This commit is contained in:
commit
3910487447
@ -10,7 +10,7 @@ local env = {
|
|||||||
MANPATH="/usr/man:.",
|
MANPATH="/usr/man:.",
|
||||||
PAGER="/bin/more",
|
PAGER="/bin/more",
|
||||||
PATH="/bin:/usr/bin:/home/bin:.",
|
PATH="/bin:/usr/bin:/home/bin:.",
|
||||||
PS1="# ",
|
PS1="$PWD# ",
|
||||||
PWD="/",
|
PWD="/",
|
||||||
SHELL="/bin/sh",
|
SHELL="/bin/sh",
|
||||||
TMP="/tmp", -- Depricated
|
TMP="/tmp", -- Depricated
|
||||||
|
@ -306,7 +306,9 @@ local userdataWrapper = {
|
|||||||
return processResult(table.pack(userdata.call(wrappedUserdata[self], processArguments(...))))
|
return processResult(table.pack(userdata.call(wrappedUserdata[self], processArguments(...))))
|
||||||
end,
|
end,
|
||||||
__gc = function(self)
|
__gc = function(self)
|
||||||
userdata.dispose(wrappedUserdata[self])
|
local data = wrappedUserdata[self]
|
||||||
|
wrappedUserdata[self] = nil
|
||||||
|
userdata.dispose(data)
|
||||||
end,
|
end,
|
||||||
-- This is the persistence protocol for userdata. Userdata is considered
|
-- This is the persistence protocol for userdata. Userdata is considered
|
||||||
-- to be 'owned' by Lua, and is saved to an NBT tag. We also get the name
|
-- to be 'owned' by Lua, and is saved to an NBT tag. We also get the name
|
||||||
@ -350,7 +352,7 @@ function wrapSingleUserdata(data)
|
|||||||
for k, v in pairs(wrappedUserdata) do
|
for k, v in pairs(wrappedUserdata) do
|
||||||
-- We need a custom 'equals' check for userdata because metamethods on
|
-- We need a custom 'equals' check for userdata because metamethods on
|
||||||
-- userdata introduced by JNLua tend to crash the game for some reason.
|
-- userdata introduced by JNLua tend to crash the game for some reason.
|
||||||
if userdata.equal(v, data) then
|
if v == data then
|
||||||
return k
|
return k
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -204,7 +204,7 @@ class Robot(val isRemote: Boolean) extends traits.Computer with traits.PowerInfo
|
|||||||
|
|
||||||
def isAnimatingTurn = animationTicksLeft > 0 && turnAxis != 0
|
def isAnimatingTurn = animationTicksLeft > 0 && turnAxis != 0
|
||||||
|
|
||||||
def animateSwing(duration: Double) = {
|
def animateSwing(duration: Double) = if (items(0).isDefined) {
|
||||||
setAnimateSwing((duration * 20).toInt)
|
setAnimateSwing((duration * 20).toInt)
|
||||||
ServerPacketSender.sendRobotAnimateSwing(this)
|
ServerPacketSender.sendRobotAnimateSwing(this)
|
||||||
}
|
}
|
||||||
|
@ -103,14 +103,6 @@ class UserdataAPI(owner: NativeLuaArchitecture) extends NativeLuaAPI(owner) {
|
|||||||
})
|
})
|
||||||
lua.setField(-2, "doc")
|
lua.setField(-2, "doc")
|
||||||
|
|
||||||
lua.pushScalaFunction(lua => {
|
|
||||||
val value1 = lua.toJavaObjectRaw(1)
|
|
||||||
val value2 = lua.toJavaObjectRaw(2)
|
|
||||||
lua.pushBoolean(value1.isInstanceOf[Value] && value2.isInstanceOf[Value] && value1 == value2)
|
|
||||||
1
|
|
||||||
})
|
|
||||||
lua.setField(-2, "equal")
|
|
||||||
|
|
||||||
lua.setGlobal("userdata")
|
lua.setGlobal("userdata")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,12 +59,6 @@ class UserdataAPI(owner: LuaJLuaArchitecture) extends LuaJAPI(owner) {
|
|||||||
owner.documentation(() => machine.documentation(value, method))
|
owner.documentation(() => machine.documentation(value, method))
|
||||||
})
|
})
|
||||||
|
|
||||||
userdata.set("equal", (args: Varargs) => {
|
|
||||||
val value1 = args.checkuserdata(1, classOf[Value])
|
|
||||||
val value2 = args.checkuserdata(2, classOf[Value])
|
|
||||||
LuaValue.valueOf(value1.isInstanceOf[Value] && value2.isInstanceOf[Value] && value1 == value2)
|
|
||||||
})
|
|
||||||
|
|
||||||
lua.set("userdata", userdata)
|
lua.set("userdata", userdata)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user