summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2022-06-27 23:59:05 +0100
committerubq323 <ubq323@ubq323.website>2022-06-27 23:59:05 +0100
commit2be0f5104695e7f02644603973135f868079dc52 (patch)
tree7074b87726735e74a74ca85d2e1e8e896f4b56ec
parent3f6068ab48f00b6176b73315ebbe08027dc6f1f2 (diff)
hole
-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