Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- returns true if the block in this directions is in the given array
- local function Forward(arr)
- local bBlockForward, data = turtle.inspect()
- local blockname = data.name
- if bBlockForward then
- for i = 1, #arr, 1 do
- if blockname == arr[i] then
- if blockname == "minecraft:lava" then
- local level = data.state.level
- if not (level == 0) then
- return false
- end
- end
- return true
- end
- end
- end
- return false
- end
- local function Up(arr)
- local bBlockUp, data = turtle.inspectUp()
- local blockname = data.name
- if bBlockUp then
- for i = 1, #arr, 1 do
- if blockname == arr[i] then
- if blockname == "minecraft:lava" then
- local level = data.state.level
- if not (level == 0) then
- return false
- end
- end
- return true
- end
- end
- end
- return false
- end
- local function Down(arr)
- local bBlockDown, data = turtle.inspectDown()
- local blockname = data.name
- if bBlockDown then
- for i = 1, #arr, 1 do
- if blockname == arr[i] then
- if blockname == "minecraft:lava" then
- local level = data.state.level
- if not (level == 0) then
- return false
- end
- end
- return true
- end
- end
- end
- return false
- end
- return { Forward = Forward, Up = Up, Down = Down}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement