You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems all code with @section craft has a lot of duplicative behavior shared with (virtually) all armor. The license isn't compatible, but I've seen that Instant Ores does this in a better way, by making a function for this. Edge cases would be best served the way this code is currently written, with abstractions for the most common cases.
(This issue is not blocking that pull request).
A few arguments for this:
Less code is less bugs
Less code is less work to maintain
Less code is less code to update when changes happen.
A lot of this code is actually documentation. It's nearly (if not exactly the same) across all of them, and could be unified to one place.
Edge cases can still be done alongside the conventional function call.
A lot of different armor mods outside of this modpack could make great use of this new API.
Problem:
I don't know where the function would go, or what it would and wouldn't cover.
A few new functions, place on the armor table and exact names are TBD
A function to register each craft recipe for each armor material. (EX: armor.register_chestplate_recepie("diamond", armor.materials.diamond))
A function to call each of the above (EX: armor.register_standard_recepies("diamond", armor.materials.diamond)
For exceptions like the two wooden shields, using only the abstractions above would be a bad idea. They should use the current API for recipe exceptions.
The registration function for shield crafting should be owned by the shields mod. The sheilds mod could perhaps override the "standard recipes" function to also register a shield. Alternatively, a data-oriented approach could be taken, and the "standard recipes" function could determine what functions to call via a list of function references stored in an accessible place.
Recipe names will be the most difficult part if the API is to work for 3rd party armor mods.
In minetest-whynot/whynot-game#170 (comment)
(This issue is not blocking that pull request).
A few arguments for this:
Problem:
I don't know where the function would go, or what it would and wouldn't cover.
Requirements
The text was updated successfully, but these errors were encountered: