Yes the "cuts trees" behaviour is still
magically adding some production of the industry's first produced cargo type, regardless of any production callbacks or other rules.
I agree that this behaviour should allow more customisation, the big question is how ambitious to be.
There's previously been discussions about industries "planting" NewObject tiles during creation or regularly, but that hasn't been implemented (fully?) yet. The opposite would also make sense, having industries that consume (or modify) NewObjects as part of their production cycle.
Another possibility is to have a new flag for the industry, making it cut down trees but instead of adding the trees to produced_cargo_waiting
, it adds the trees to incoming_cargo_waiting
and calls the cargo delivered callback, so the tree cutting is handled as if it was a delivery of cargo. However this could cause some other issues with needing to reserve a cargo slot in the industry for the cut trees, possibly needing a cargo type label for the cut trees, and how to handle things in the UI.
A third idea is to have (again) a new flag, which signals that one of the industry's permanent storage slots is used for "cut trees needing processing". That's slightly more clean, but still not a good solution.
From a technical viewpoint, doing something general-ish that (also) supports newobjects in addition to trees seems like the smartest and less hacky. It also requires much more up-front design.