if we cant fix every dupe glitch then theres little point to fixing any of them.
the mod will still be great as a "creative mode" level thing.
youve already mentioned needing to detect illegal undergrounds.
stop long inserters passing illegally by making walls 2 thick. if that messes with detecting complete modules, then the second layer could be modded_wall (with no drops) that gets spawned in with the loaders etc.
dont allow gates in the module boundary. (currently i can park a cargo-wagon in the gate, unload it inside the module while reloading those same items to the same wagon outside the module. the same can be done with cars)
actually ban logistic chests by having the secondary modules stop working.
need to somehow prevent manually adding items to entities in primary modules. setting entity.force="enemy" does this, then on breaking the primary module we have to set them back to force="player". this means most changes to a primary module can only be made by breaking it :/
to prevent dropping items on the ground inside primary modules, spawn copies of a simple-entity with a collison box under the whole area. (this is gonna stop us placing anything more in there, remove them on breaking the module, which will then be the only way to edit a primary module?)
on creating a primary module clear all its inventory contents (else we can dupe a storage room)
on creating secondary modules, checking for no ghosts is insufficient. (on placing a blueprint i can remove all the ghosts but place the outline and still get a working copy)
it needs a full entity for entity check on creation. (this shouldnt be anywhere near as expensive as the 1 minute delay makes it seem. id expect one small module to be under a second to check.)
currently, adding to a primary module goes undetected if it doesnt have any secondary modules? (i can create an empty module with 0 power draw, then add machines - power draw isnt updated. i can then create working copies with 0 power draw.)
mining modules should track ore depletion and remove the same amount from secondary modules - if the amount and type of ore isnt present then that copy should stop working.
no idea how this is done for oil? :/
also ore currently gets destroyed under chests and loaders that get spawned in.
but like i said, most of that is irrelevant if we simply accept the mod as a "creative mode" level thing.
on fluid input/output i would copy the code from Factorissimo2 under the MIT licence.
and now im gonna build 100kspm factory, fingers crossed for more than 1ups.
thank you :)