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