mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-07-26 21:16:23 +09:00
29 lines
800 B
Lua
29 lines
800 B
Lua
local main = {}
|
|
|
|
function main.build(event)
|
|
if event.entity.type ~= 'loader-1x1' then
|
|
return
|
|
end
|
|
|
|
if prototypes.entity['loader-1x1'] then
|
|
local p = event.entity.surface.create_entity{name = 'loader-1x1', position = {event.entity.position.x, event.entity.position.y}, force = 'neutral', quality = event.entity.quality.name}
|
|
p.destructible = false
|
|
end
|
|
end
|
|
|
|
function main.destroy(event)
|
|
if event.entity.type ~= 'loader-1x1' then
|
|
return
|
|
end
|
|
|
|
if prototypes.entity['loader-1x1'] then
|
|
local p = event.entity.surface.find_entity({name = 'loader-1x1', force = 'neutral', quality = event.entity.quality.name}, {event.entity.position.x, event.entity.position.y})
|
|
|
|
if p then
|
|
p.destroy()
|
|
end
|
|
end
|
|
end
|
|
|
|
return main
|