fix(mine.lua): fixed bug with moving to start_v in mine
Turtle was mining too much, too soon
This commit is contained in:
parent
c7d317512b
commit
b7e5ff879e
1 changed files with 8 additions and 8 deletions
16
mine.lua
16
mine.lua
|
|
@ -254,6 +254,14 @@ function mine (block)
|
|||
local height = block.v2.y + offset
|
||||
local start_v = copy_v(block.v1)
|
||||
local end_v = block.v1 + block.v2
|
||||
if height > 2 then
|
||||
start_v = start_v + UNIT_Y
|
||||
end_v = end_v - UNIT_Y
|
||||
elseif height < -2 then
|
||||
start_v = start_v - UNIT_Y
|
||||
end_v = end_v + UNIT_Y
|
||||
end
|
||||
moveAbs(start_v)
|
||||
if height % 3 == 0 then
|
||||
mode.mine = { up = true, forward = true, down = true }
|
||||
elseif height == 2 then
|
||||
|
|
@ -263,14 +271,6 @@ function mine (block)
|
|||
mode.mine = { forward = true, down = true }
|
||||
end_v = end_v + UNIT_Y
|
||||
end
|
||||
if height > 2 then
|
||||
start_v = start_v + UNIT_Y
|
||||
end_v = end_v - UNIT_Y
|
||||
elseif height < -2 then
|
||||
start_v = start_v - UNIT_Y
|
||||
end_v = end_v + UNIT_Y
|
||||
end
|
||||
moveAbs(start_v)
|
||||
moveAbs(end_v)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue