fix(turtle-utils): waitForMatureCrop
This commit is contained in:
parent
1e9536b089
commit
88d8fae296
@ -37,7 +37,7 @@ turtleUtils.waitForMatureCrop = function(inspectFn, sleepTime)
|
|||||||
inspectFn = inspectFn or turtle.inspect
|
inspectFn = inspectFn or turtle.inspect
|
||||||
|
|
||||||
return waitFor(function()
|
return waitFor(function()
|
||||||
return turtleUtils.isMatureCrop(inspectFn)
|
return turtleUtils.getMatureCrop(inspectFn)
|
||||||
end, sleepTime)
|
end, sleepTime)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -125,13 +125,18 @@ turtleUtils.getFuelPercentage = function()
|
|||||||
return (turtle.getFuelLevel() / turtle.getFuelLimit()) * 100
|
return (turtle.getFuelLevel() / turtle.getFuelLimit()) * 100
|
||||||
end
|
end
|
||||||
|
|
||||||
turtleUtils.isMatureCrop = function(inspectFn)
|
turtleUtils.getMatureCrop = function(inspectFn)
|
||||||
inspectFn = inspectFn or turtle.inspect
|
inspectFn = inspectFn or turtle.inspect
|
||||||
|
|
||||||
return function()
|
return function()
|
||||||
local isBlock, block = inspectFn()
|
local isBlock, block = inspectFn()
|
||||||
local blockStateAge = block and block.state and block.state.age
|
local blockStateAge = block and block.state and block.state.age
|
||||||
return blockStateAge == 7
|
|
||||||
|
if blockStateAge == 7 then
|
||||||
|
return block.name
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user