Update 'Turtle/Wheat.lua'
This commit is contained in:
parent
23dbfbed8b
commit
dd526c3005
@ -1,11 +1,5 @@
|
|||||||
Wheat = {}
|
require("Turtle")
|
||||||
|
Wheat = Turtle:new()
|
||||||
function Wheat:new(t)
|
|
||||||
t = t or {}
|
|
||||||
setmetatable(t, self)
|
|
||||||
self.__index = self
|
|
||||||
return t
|
|
||||||
end
|
|
||||||
|
|
||||||
function Wheat:getStatusDown()
|
function Wheat:getStatusDown()
|
||||||
local bd, data = turtle.inspectDown()
|
local bd, data = turtle.inspectDown()
|
||||||
@ -19,25 +13,5 @@ end
|
|||||||
function Wheat:isPlantable(slot, update)
|
function Wheat:isPlantable(slot, update)
|
||||||
self:assertInvUpdate(update)
|
self:assertInvUpdate(update)
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function Wood:updateInv()
|
|
||||||
self.inv = {}
|
|
||||||
for slot = 1, 16 do
|
|
||||||
self.inv[slot] = turtle.getItemDetail(slot, true)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function Wood:assertInvUpdate(update)
|
|
||||||
if (update ~= false) then update = true end
|
|
||||||
|
|
||||||
if self.inv == nil then
|
|
||||||
update = true
|
|
||||||
end
|
|
||||||
|
|
||||||
assert(type(update) == "boolean","update must be of the type boolean")
|
|
||||||
if update == true then
|
|
||||||
self:updateInv()
|
|
||||||
end
|
|
||||||
end
|
end
|
Loading…
x
Reference in New Issue
Block a user