mirror of
https://github.com/kepler155c/opus
synced 2025-08-30 09:28:02 +00:00
manipulators!
This commit is contained in:
@@ -155,18 +155,23 @@ end
|
||||
|
||||
drivers['manipulator'] = function(dev)
|
||||
if dev.getName then
|
||||
local name = dev.getName()
|
||||
if dev.getInventory then
|
||||
createDevice(name .. ':inventory', 'inventory', 'getInventory', dev)
|
||||
end
|
||||
if dev.getEquipment then
|
||||
createDevice(name .. ':equipment', 'equipment', 'getEquipment', dev)
|
||||
end
|
||||
if dev.getEnder then
|
||||
createDevice(name .. ':enderChest', 'enderChest', 'getEnder', dev)
|
||||
end
|
||||
local name
|
||||
pcall(function()
|
||||
name = dev.getName()
|
||||
end)
|
||||
if name then
|
||||
if dev.getInventory then
|
||||
createDevice(name .. ':inventory', 'inventory', 'getInventory', dev)
|
||||
end
|
||||
if dev.getEquipment then
|
||||
createDevice(name .. ':equipment', 'equipment', 'getEquipment', dev)
|
||||
end
|
||||
if dev.getEnder then
|
||||
createDevice(name .. ':enderChest', 'enderChest', 'getEnder', dev)
|
||||
end
|
||||
|
||||
return dev._children
|
||||
return dev._children
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user