Some tweaks to mine.lua.
- Checks for movement success now, tries to ensure movement even if a block falls in front of the turtle. - Fixed the bug for depths of 1 mod 3 leaving a plane of blocks.
This commit is contained in:
parent
efda5103c0
commit
ea9bd903ac
1 changed files with 16 additions and 7 deletions
23
mine.lua
23
mine.lua
|
|
@ -30,9 +30,11 @@ function moveInLine (delta)
|
|||
if mode.mine.forward then
|
||||
turtle.dig()
|
||||
end
|
||||
turtle.forward()
|
||||
mineSides()
|
||||
delta = delta - 1
|
||||
local success = turtle.forward()
|
||||
if success then
|
||||
mineSides()
|
||||
delta = delta - 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -42,15 +44,19 @@ function moveUpDown (delta)
|
|||
if mode.mine.forward then
|
||||
turtle.digUp()
|
||||
end
|
||||
turtle.up()
|
||||
delta = delta - 1
|
||||
local success = turtle.up()
|
||||
if success then
|
||||
delta = delta - 1
|
||||
end
|
||||
end
|
||||
while delta < 0 do
|
||||
if mode.mine.forward then
|
||||
turtle.digDown()
|
||||
end
|
||||
turtle.down()
|
||||
delta = delta + 1
|
||||
local success = turtle.down()
|
||||
if success then
|
||||
delta = delta + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -206,6 +212,9 @@ function mine (block)
|
|||
local excess = remaining_h % 3
|
||||
if excess > 0 then
|
||||
minePlane(block.xoff, block.yoff, (excess - 1) * z_dir)
|
||||
if excess == 1 then
|
||||
move(0, 0, -z_dir)
|
||||
end
|
||||
remaining_h = remaining_h - excess
|
||||
else
|
||||
move(0, 0, z_dir)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue