The newly-added preview items (#40) didn't play nice with the side
preview image, mostly because the "layers" metadata wasn't generated,
and they didn't record the base color of the actual banner being crafted.
This commit re-adds that (and other) metadata.
The `layer` string was inherited from the old patch, which I frankly
don't understand. I restructured it to `follow make_banner_texture` more
closely, with the addition of the mcl_banners_front mask, which
prevents the rear portions of the patterns from showing up.
The numbers in the final `[combine` and `[resize` steps are arbitrary,
and were derived by trial-and-error.
A preview of a crafted banner is now shown next to the craft result box
to help players visualize what they're crafting. Due to the formspec
version, the preview can't be shown over top of the actual result slot.
A utility function (mcl_banners.get_overlay) is added to generate
formspec-able texture strings for arbitrary banners.
At some point in the past, Minetest had a bug that caused rendering
issues with transparent textures, like those used for banner gradients.
As a workaround, the number of allowed layers was reduced for banners
containing gradients. The engine bug has since been fixed, but the limit
was never removed.
This commit removes the limit.
See also: Mineclonia/Mineclonia#72 (comment)
and https://github.com/minetest/minetest/issues/6210
In commit ac5f115f83, preview banners were introduced and given
crafting recipes. Those crafting recipes were the same as for banners without a pattern. That
change made banners without patterns uncraftable and preview banners craftable instead – this
patch makes banners without patterns craftable again and preview banners uncraftable.