So, I've been working on a minimod that changes what the Planetary Shield does.
My first implementation, I made a new data.scripts.PlanetaryShield, and changed industries.csv to refer to the new class.
This... technically worked, but ran into some problems, because it turns out that the save file, in several places, refers to industries by their class name rather than their id. Specifically, any planetary shield generators that were built or under construction when you enabled the mod would retain the old behavior, and, if you wanted to disable the mod, you had to scrap all of the new shield generators... and then wait two months or the save would crash on load because their class was being stored in the monthly planetary expenses report.
This seems like it's a bug, but it's a fairly esoteric one, and who knows, maybe there's some actual reason why it's important to store the class name.
So, try number two: see if I could overwrite com.fs.starfarer.api.impl.campaign.econ.impl.PlanetaryShield - even using a built jar file, this doesn't work; starsector continues to use its own copy of the PlanetaryShield class rather than the new one.
Before I move on to try number three, where I build code that will, on mod-add, iterate through every market to remove and re-create any existing planetary shields, I have to ask: Can anyone come up with a better way of doing this? Because that won't solve the on-mod-remove issues, and I'd really like for this to be a straightforward add mod, get new behavior, remove mod, get old behavior, sort of thing, without any gotchas going in either direction.