This commit is contained in:
2026-05-01 21:54:42 +09:00
parent d8a6067a3f
commit 6466f04d0f
5 changed files with 116 additions and 71 deletions
+36
View File
@@ -0,0 +1,36 @@
local main = {}
function main.build(event)
if event.entity.type ~= 'lab' then
return
end
if not prototypes.entity['proxy-container'] then
return
end
local p = event.entity.surface.create_entity{name = 'proxy-container', position = {event.entity.position.x, event.entity.position.y}, force = 'neutral', quality = event.entity.quality.name}
p.destructible = false
p.proxy_target_entity = event.entity
p.proxy_target_inventory = defines.inventory.lab_input
end
function main.destroy(event)
if event.entity.type ~= 'lab' then
return
end
if not prototypes.entity['proxy-container'] then
return
end
local p = event.entity.surface.find_entity({name = 'proxy-container', force = 'neutral', quality = event.entity.quality.name}, {event.entity.position.x, event.entity.position.y})
if not p then
return
end
p.destroy()
end
return main