In that ResourceCallHandler:harvest_entity() function, we have this piece of code:
if renewable_resource_node and renewable_resource_node:get_harvest_overlay_effect() then
renewable_resource_node:request_harvest(session.player_id)
elseif resource_node then
...
end
If the entity have a renewable option, it will always try to harvest the renewable resource, even when it has not replenished yet. It will never try the non-renewable option.
In the archipelago, I modded that, into this:
if renewable_resource_node and renewable_resource_node:get_harvest_overlay_effect() and renewable_resource_node:is_harvestable() then
renewable_resource_node:request_harvest(session.player_id)
elseif resource_node then
...
end
Just one extra condition, renewable_resource_node:is_harvestable()
was added.
This forces it to fail in case the entity was harvested and have not replenished yet, and finally try the non-renewable option instead.
It is what makes palm/papaya trees work, you harvest it for renewable coconuts, then if you try again, it will chop the tree, unless you gave it enough time to grow the coconuts back.