update treeFarmer

This commit is contained in:
Julian Brammer 2024-06-02 16:37:22 +02:00
parent 337d9c2191
commit e80c8b7a78

View File

@ -1,3 +1,5 @@
local fallingTreeModUsed = true
woodList = { woodList = {
[0] = "minecraft:oak_log", [0] = "minecraft:oak_log",
[1] = "minecraft:dark_oak_log", [1] = "minecraft:dark_oak_log",
@ -59,7 +61,7 @@ local function placeTree()
end end
end end
local function emptyWood() local function emptyInventory()
for i=1, 16 do for i=1, 16 do
turtle.select(i) turtle.select(i)
itemDetail = turtle.getItemDetail() itemDetail = turtle.getItemDetail()
@ -73,16 +75,30 @@ local function emptyWood()
end end
function main() function main()
while true do if fallingTreeModUsed then
blockFound, blockData = turtle.inspect() while true do
if isWood(blockData) then blockFound, blockData = turtle.inspect()
recursiveTreeFarming() if isWood(blockData) then
sleep(1) turtle.dig()
placeTree() sleep(1)
emptyInventory() placeTree()
emptyInventory()
end
print("waiting for tree...")
sleep(10)
end
else
while true do
blockFound, blockData = turtle.inspect()
if isWood(blockData) then
recursiveTreeFarming()
sleep(1)
placeTree()
emptyInventory()
end
print("waiting...")
sleep(10)
end end
sleep(10)
print("waiting...")
end end
end end