From 3de03bef22c6a9fa177b474b4e3fd3b9606d90c8 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Fri, 21 Dec 2018 20:58:41 -0500 Subject: [PATCH] manipulator device :( --- sys/extensions/1.device.lua | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/sys/extensions/1.device.lua b/sys/extensions/1.device.lua index 003ae14..d580563 100644 --- a/sys/extensions/1.device.lua +++ b/sys/extensions/1.device.lua @@ -155,23 +155,22 @@ end drivers['manipulator'] = function(dev) if dev.getName then - 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 + local name = dev.getName() + 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 - end + return dev._children + end + end) end end