updated treeFarmer
This commit is contained in:
parent
67ecf5ac19
commit
dcec651f01
@ -13,6 +13,36 @@ local function isWood(blockData)
|
||||
return false
|
||||
end
|
||||
|
||||
local function recursiveTreeFarming()
|
||||
for i=0, 3 do
|
||||
turtle.turnLeft()
|
||||
blockFound, blockData = turtle.inspect()
|
||||
if isWood(blockData) then
|
||||
turtle.dig()
|
||||
turtle.forward()
|
||||
recursiveTreeFarming()
|
||||
turtle.back()
|
||||
end
|
||||
end
|
||||
|
||||
blockFound, blockData = turtle.inspectUp()
|
||||
if isWood(blockData) then
|
||||
turtle.digUp()
|
||||
turtle.up()
|
||||
recursiveTreeFarming()
|
||||
turtle.down()
|
||||
end
|
||||
|
||||
blockFound, blockData = turtle.inspectDown()
|
||||
if isWood(blockData) then
|
||||
turtle.digDown()
|
||||
turtle.down()
|
||||
recursiveTreeFarming()
|
||||
turtle.up()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function placeTree()
|
||||
for i=1, 16 do
|
||||
turtle.select(i)
|
||||
@ -33,7 +63,7 @@ function main()
|
||||
while true do
|
||||
blockFound, blockData = turtle.inspect()
|
||||
if isWood(blockData) then
|
||||
turtle.dig()
|
||||
recursiveTreeFarming()
|
||||
sleep(1)
|
||||
placeTree()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user