From 2be0f5104695e7f02644603973135f868079dc52 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 27 Jun 2022 23:59:05 +0100 Subject: hole --- hole.lua | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/hole.lua b/hole.lua index 8eb8c68..cbbb0b2 100644 --- a/hole.lua +++ b/hole.lua @@ -12,17 +12,20 @@ while true do local scanned = scanner.scan() local targets = {} for _,s in ipairs(scanned) do - local should_add = true - for i,t in ipairs(targets) do - if t.x == s.x and t.z == s.z then - should_add = false - if s.y > t.y then - targets[i] = s + if s.name ~= "minecraft:air" then + local should_add = true + + for i,t in ipairs(targets) do + if t.x == s.x and t.z == s.z then + should_add = false + if s.y > t.y then + targets[i] = s + end end end - end - if should_add then - table.insert(targets,s) + if should_add then + table.insert(targets,s) + end end end for _,v in ipairs(targets) do -- cgit v1.2.3