treefarm bug fixes
This commit is contained in:
@@ -6,7 +6,7 @@ _G.requireInjector()
|
|||||||
Area around turtle must be flat and can only be dirt or grass
|
Area around turtle must be flat and can only be dirt or grass
|
||||||
(10 blocks in each direction from turtle)
|
(10 blocks in each direction from turtle)
|
||||||
Turtle must have: crafting table, chest
|
Turtle must have: crafting table, chest
|
||||||
Turtle must have a pick equipped
|
Turtle must have a pick equipped on the RIGHT side
|
||||||
|
|
||||||
Optional:
|
Optional:
|
||||||
Add additional sapling types that can grow with a single sapling
|
Add additional sapling types that can grow with a single sapling
|
||||||
@@ -140,8 +140,22 @@ local function craftItem(item, qty)
|
|||||||
return success
|
return success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function emptyFurnace()
|
||||||
|
if state.cooking then
|
||||||
|
|
||||||
|
print('Emptying furnace')
|
||||||
|
|
||||||
|
turtle.suckDownAt(state.furnace)
|
||||||
|
turtle.suckForwardAt(state.furnace)
|
||||||
|
turtle.suckUpAt(state.furnace)
|
||||||
|
setState('cooking')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function cook(item, count, result, fuel, fuelCount)
|
local function cook(item, count, result, fuel, fuelCount)
|
||||||
|
|
||||||
|
emptyFurnace()
|
||||||
|
|
||||||
setState('cooking', true)
|
setState('cooking', true)
|
||||||
|
|
||||||
fuel = fuel or CHARCOAL
|
fuel = fuel or CHARCOAL
|
||||||
@@ -154,9 +168,19 @@ local function cook(item, count, result, fuel, fuelCount)
|
|||||||
count = count + turtle.getItemCount(result)
|
count = count + turtle.getItemCount(result)
|
||||||
turtle.select(1)
|
turtle.select(1)
|
||||||
turtle.pathfind(Point.below(state.furnace))
|
turtle.pathfind(Point.below(state.furnace))
|
||||||
|
|
||||||
|
local lastSuck = os.clock()
|
||||||
repeat
|
repeat
|
||||||
os.sleep(1)
|
os.sleep(1)
|
||||||
turtle.suckUp()
|
if turtle.suckUp() then
|
||||||
|
lastSuck = os.clock()
|
||||||
|
end
|
||||||
|
|
||||||
|
if os.clock() - lastSuck > 10 then
|
||||||
|
-- sponge bug
|
||||||
|
Util.print('Timed out waiting for furnace')
|
||||||
|
return
|
||||||
|
end
|
||||||
until turtle.getItemCount(result) >= count
|
until turtle.getItemCount(result) >= count
|
||||||
|
|
||||||
setState('cooking')
|
setState('cooking')
|
||||||
@@ -225,18 +249,6 @@ local function makeCharcoal()
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local function emptyFurnace()
|
|
||||||
if state.cooking then
|
|
||||||
|
|
||||||
print('Emptying furnace')
|
|
||||||
|
|
||||||
turtle.suckDownAt(state.furnace)
|
|
||||||
turtle.suckForwardAt(state.furnace)
|
|
||||||
turtle.suckUpAt(state.furnace)
|
|
||||||
setState('cooking')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function getCobblestone(count)
|
local function getCobblestone(count)
|
||||||
|
|
||||||
local slots = turtle.getSummedInventory()
|
local slots = turtle.getSummedInventory()
|
||||||
@@ -602,7 +614,20 @@ local function findGround()
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
if b == COBBLESTONE or b == STONE then
|
if b == COBBLESTONE then
|
||||||
|
turtle.back()
|
||||||
|
local s2, b2 = turtle.inspectDown()
|
||||||
|
if not s2 then
|
||||||
|
error('lost')
|
||||||
|
end
|
||||||
|
if b2.name == COBBLESTONE then
|
||||||
|
turtle.turnLeft()
|
||||||
|
turtle.back()
|
||||||
|
end
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
if b == STONE then
|
||||||
error('lost')
|
error('lost')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user