Update 'Turtle/Wheat.lua'
This commit is contained in:
parent
680b11c81c
commit
624073bade
@ -268,6 +268,8 @@ function Wheat:plantAll(goBack)
|
||||
end
|
||||
|
||||
function Wheat:harvestAll(goBack)
|
||||
local startTime = os.clock()
|
||||
local yield = 0
|
||||
if (goBack == nil) then goBack = true end
|
||||
if(goBack == true) then
|
||||
goBack = {self.x, self.y, self.z, self.dir}
|
||||
@ -286,6 +288,7 @@ function Wheat:harvestAll(goBack)
|
||||
line[j] = self:getStatusDown()
|
||||
end
|
||||
if(line[j] == 7) then
|
||||
yield = yield + 1
|
||||
turtle.digDown()
|
||||
turtle.placeDown()
|
||||
line[j] = 0
|
||||
@ -318,6 +321,8 @@ function Wheat:harvestAll(goBack)
|
||||
self:log("moving to goBack")
|
||||
self:moveTo(goBack)
|
||||
end
|
||||
self.lastHarvestDuration = os.clock() - startTime
|
||||
self.lastYield = yield
|
||||
|
||||
end
|
||||
|
||||
@ -340,4 +345,4 @@ function Wheat:arrayToString(a)
|
||||
end
|
||||
s = s .. "}"
|
||||
return s
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user