updated treeFarmer
This commit is contained in:
parent
cff591f562
commit
0fb089db5e
@ -51,7 +51,7 @@ local function placeTree()
|
|||||||
local itemDetail = turtle.getItemDetail()
|
local itemDetail = turtle.getItemDetail()
|
||||||
|
|
||||||
if itemDetail ~= nil then
|
if itemDetail ~= nil then
|
||||||
if itemDetail.name == "minecraft:oak_sapling" then
|
if itemDetail.name == "minecraft:spruce_sapling" then
|
||||||
local blockFound, blockData = turtle.inspect()
|
local blockFound, blockData = turtle.inspect()
|
||||||
if not blockFound then
|
if not blockFound then
|
||||||
turtle.up()
|
turtle.up()
|
||||||
@ -74,7 +74,7 @@ local function emptyInventory()
|
|||||||
turtle.select(i)
|
turtle.select(i)
|
||||||
itemDetail = turtle.getItemDetail()
|
itemDetail = turtle.getItemDetail()
|
||||||
if itemDetail ~= nil then
|
if itemDetail ~= nil then
|
||||||
if itemDetail.name == "minecraft:oak_log" then
|
if itemDetail.name == "minecraft:spruce_log" then
|
||||||
turtle.refuel()
|
turtle.refuel()
|
||||||
turtle.dropDown()
|
turtle.dropDown()
|
||||||
end
|
end
|
||||||
@ -98,14 +98,18 @@ function main()
|
|||||||
else
|
else
|
||||||
while true do
|
while true do
|
||||||
blockFound, blockData = turtle.inspect()
|
blockFound, blockData = turtle.inspect()
|
||||||
if isWood(blockData) then
|
if blockFound then
|
||||||
recursiveTreeFarming()
|
if isWood(blockData) then
|
||||||
sleep(1)
|
recursiveTreeFarming()
|
||||||
|
sleep(1)
|
||||||
|
placeTree()
|
||||||
|
emptyInventory()
|
||||||
|
end
|
||||||
|
print("waiting...")
|
||||||
|
sleep(10)
|
||||||
|
else
|
||||||
placeTree()
|
placeTree()
|
||||||
emptyInventory()
|
|
||||||
end
|
end
|
||||||
print("waiting...")
|
|
||||||
sleep(10)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user