Thank you for correcting me. I had forgotten about that part of the code.
The line is
if data.raw.resource["offshore-oil"] then
if not mods["Water_Ores"] then
[Modify collision masks so that water ores stay on water and land ores stay on land]
If offshore oil is disabled, or if Water Ores is enabled, then no collision mask changes are made. Refreshing my memory, the reason for that line is that Oil Rigs used to be able to mine normal oil as well, so if Water Ores put normal oil in the water then Cargo Ships didn't need to do anything extra. That condition was a compatibility fix/hack to accommodate that mod and not mess up its other changes to collision masks. Now that offshore-oil has its own resource generation slider, and Oil Rigs can only mine "offshore resources", I'm not sure this compatibility fix even makes sense anymore.
Can you explain exactly what you want to do that this code is interfering with? Do you want to make something similar to Water Ores? I'm sure we can come to a solution together.