add some checks inside place
This commit is contained in:
@@ -243,16 +243,20 @@ local function move(direction)
|
|||||||
end
|
end
|
||||||
local function place(direction)
|
local function place(direction)
|
||||||
local func = turtle.place
|
local func = turtle.place
|
||||||
|
local cfunc = turtle.compare
|
||||||
if direction == "down" then
|
if direction == "down" then
|
||||||
func = turtle.placeDown
|
func = turtle.placeDown
|
||||||
|
cfunc = turtle.compareDown
|
||||||
end
|
end
|
||||||
if direction == "up" then
|
if direction == "up" then
|
||||||
func = turtle.placeUp
|
func = turtle.placeUp
|
||||||
|
cfunc = turtle.compareUp
|
||||||
end
|
end
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
local suc = func()
|
local suc = func()
|
||||||
if not suc then -- next slot
|
if not suc then -- next slot
|
||||||
|
if cfunc() and turtle.getItemDetail(turtle.getSelectedSlot())["name"] ~= "minecraft:air" then return end
|
||||||
local current = turtle.getSelectedSlot()
|
local current = turtle.getSelectedSlot()
|
||||||
if current == 16 then
|
if current == 16 then
|
||||||
turtle.select(1)
|
turtle.select(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user