summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hole.lua21
1 files 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