This commit is contained in:
2025-02-12 20:39:07 +09:00
parent 9e0ed189ee
commit 822258eee0

View File

@@ -110,30 +110,13 @@ local function miner_check(entity)
if config.fluid and entity.fluidbox and #entity.fluidbox > 0 then if config.fluid and entity.fluidbox and #entity.fluidbox > 0 then
table.insert(pipe_build, { x = 0, y = 0 }) table.insert(pipe_build, { x = 0, y = 0 })
local rh = math.ceil(er / 2)
local r = er + 1
local entities = es.find_entities_filtered{ area = { { ep.x - r, ep.y - r }, { ep.x + r, ep.y + r } }, type = { "mining-drill", "pipe", "pipe-to-ground" } } for i = 1, #entity.fluidbox do
local entities_t = es.find_entities_filtered{ area = { { ep.x - r, ep.y - r }, { ep.x + r, ep.y + r } }, ghost_type = { "mining-drill", "pipe", "pipe-to-ground" } } for _, p in pairs(entity.fluidbox[i].get_pipe_connections(i)) do
for x = 1, p.position.x do
table.insert_array(entities, entities_t) for y = 1, p.position.y do
table.insert(pipe_build, { x = x, y = y })
for _, e in pairs(entities) do
if (e.position.x > ep.x) and (e.position.y == ep.y) then
for h = 1, rh do
table.insert(pipe_build, { x = h, y = 0 })
end end
elseif (e.position.x < ep.x) and (e.position.y == ep.y) then
for h = 1, rh do
table.insert(pipe_build, { x = -h, y = 0 })
end
elseif (e.position.x == ep.x) and (e.position.y > ep.y) then
for h = 1, rh do
table.insert(pipe_build, { x = 0, y = h })
end
elseif (e.position.x == ep.x) and (e.position.y < ep.y) then
for h = 1, rh do
table.insert(pipe_build, { x = 0, y = -h })
end end
end end
end end