Wrap peripheral if string is given instead of table
This commit is contained in:
parent
3dabc55825
commit
742f8eb81d
@ -108,15 +108,19 @@ local metatable = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function localchest.fromPeripheral(per)
|
function localchest.fromPeripheral(per)
|
||||||
local chest = {
|
if type(per) == "string" then
|
||||||
peripheral = per,
|
per = peripheral.wrap(per)
|
||||||
slots = {},
|
end
|
||||||
size = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
setmetatable(chest, metatable)
|
local chest = {
|
||||||
|
peripheral = per,
|
||||||
|
slots = {},
|
||||||
|
size = 0
|
||||||
|
}
|
||||||
|
|
||||||
return chest
|
setmetatable(chest, metatable)
|
||||||
|
|
||||||
|
return chest
|
||||||
end
|
end
|
||||||
|
|
||||||
function localchest.fromString(str)
|
function localchest.fromString(str)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user