Добавлены все обновления от сообщества, вплоть до #148

This commit is contained in:
2024-09-12 14:28:43 +03:00
parent 98159766c4
commit 487a0e6e16
8841 changed files with 23077 additions and 20175 deletions

View File

@@ -0,0 +1,46 @@
function table.contains(table, element)
for _, value in pairs(table) do
if value == element then
return true
end
end
return false
end
local offshore_pump_types = {
"offshore-mk0-pump", "offshore-pump", "offshore-mk2-pump",
"offshore-mk3-pump", "offshore-mk4-pump", "seafloor-pump",
"seafloor-pump-2", "seafloor-pump-3"
}
for _, surface in pairs(game.surfaces) do
for _, entity in pairs(surface.find_entities_filtered{name = {"offshore-mk0-pump-output", "offshore-pump-output", "offshore-mk2-pump-output", "offshore-mk3-pump-output", "offshore-mk4-pump-output", "seafloor-pump-output", "seafloor-pump-2-output", "seafloor-pump-3-output"}}) do
local position = entity.position
local direction = entity.direction
local force = entity.force
-- -- Удаление старой сущности (пока не надо)
-- entity.destroy()
-- Определение соответствующей сущности без суффикса "-output"
local base_name = string.gsub(entity.name, "-output", "")
-- Создание новой сущности, соответствующей без суффикса "-output"
if table.contains(offshore_pump_types, base_name) then
surface.create_entity{
name = base_name,
position = position,
direction = direction,
force = force
}
if base_name ~= "offshore-mk0-pump" then
surface.create_entity{
name = "hidden-electric-pole",
position = position,
direction = direction,
force = force
}
end
end
end
end

View File

@@ -0,0 +1,58 @@
{
"entity": [
[
"offshore-pump-0",
"offshore-mk0-pump-output"
],
[
"offshore-pump-1",
"offshore-pump-output"
],
[
"offshore-pump-2",
"offshore-mk2-pump-output"
],
[
"offshore-pump-3",
"offshore-mk3-pump-output"
],
[
"offshore-pump-4",
"offshore-mk4-pump-output"
],
[
"seafloor-pump",
"seafloor-pump-output"
],
[
"seafloor-pump-2",
"seafloor-pump-2-output"
],
[
"seafloor-pump-3",
"seafloor-pump-3-output"
]
],
"item": [
[
"offshore-pump-0",
"offshore-mk0-pump"
],
[
"offshore-pump-1",
"offshore-pump"
],
[
"offshore-pump-2",
"offshore-mk2-pump"
],
[
"offshore-pump-3",
"offshore-mk3-pump"
],
[
"offshore-pump-4",
"offshore-mk4-pump"
]
]
}