Also, I found an actual incompatibility: More Quality Scaling replaces quality solar collectors with tweaked variants (higher max temperature and/or heat capacity), which are not affected by your script.
You could look for the modified variants and treat them the same as solar-collector in your code (1), or add solar-collector to the MQS blacklist (if data.raw["mod-data"] and data.raw["mod-data"]["clone-blacklist"] then data.raw["mod-data"]["clone-blacklist"].data["solar-collector"] = true end, ideally in the data-updates stage to not depend on load order), to fix this issue.
(1) these were all the changes necessary to make it work for me locally:
-- add at the top of solar.lua
local solar_filters = {{filter = "name", name = "solar-collector"}, {filter = "name", name = "solar-mirror"}}
local solar_power_2_items = { "solar-collector", "solar-mirror" }
local collector_names = {"solar-collector"}
local collector_names_i = {["solar-collector"]=true}
-- MQS registers clones in a mod_data entry
if prototypes.mod_data["entity-clones"] then
for _,name in pairs(prototypes.mod_data["entity-clones"].data["solar-collector"]) do
table.insert(collector_names, name)
collector_names_i[name] = true
table.insert(solar_filters,{filter="name",name=name})
table.insert(solar_power_2_items, name)
end
end
-- pass the array instead of the single entity name in find_entities_filtered
local solar_collectors = surface.find_entities_filtered{area = {{x_lower, y_lower}, {x_upper, y_upper}}, name = collector_names}
-- replace
if event.name == "solar-collector" then
-- with
if collector_names_i[event.name] then
-- in two places
-- not sure if necessary - in handle_teleport_f queue struct
name = collector.name, -- instead of "solar-collector"
-- and comment out/remove the array definitions that were moved up before the entity-clones loop (solar_filters/solar_power_2_items)