Sweet great job, works now :)
Regarding the stack size and spilling of items.
Can't you instead of using the stack size of the turrets, use the stack size of the ammunition?
Then you can also have an additional mod-option that let us choose the % of stack size we want the loaded turrets to have.
This will also clean up the recipes a bit, so we only have 1 recipe for each type of ammo a turret use. (Now it's one for 10 and one for 20 for normal turret at least).
E.g.
Ammo loaded: 0.2 - would make recipes use 20% of max stack size of the ammo used and load the turret accordingly.
Ammo loaded: 1.0 - would make recipes use 100% of max stack size of the ammo used to load the turret accordingly.
If max stack size is 1, then just round up to nearest integer.
Idk if this is possible, but would make it more compatible with other mods maybe.