andrewminer / crafting-guide

The ultimate step-by-step guide to make anything in Minecraft
http://crafting-guide.com
66 stars 192 forks source link

Update crafting algorithm to select best recipe for available tools #182

Closed andrewminer closed 7 years ago

andrewminer commented 8 years ago

PROBLEM:

When an item has multiple recipes listed in the mod-version.cg file, the current crafting algorithm always chooses the first one. This frequently results in a sub-optimal crafting plan because the use of other recipes may be more efficient under different circumstances. For example, when making Copper Cable in IC2, one can use a combination of Forge Hammer and Cutters or simply use a Metal Former. While the latter takes more resources to build (and power to run), it is both faster and produced more cable for each copper ingot used.

SOLUTION:

The recipes for a given item should be listed in their preferred order assuming that any and all tools are available for free. Then, the crafting algorithm should be altered to choose the first recipe listed for which the necessary tools are already available in the "Items You Have" list. If no recipe can be found for which all the needed tools are available, then the last recipe in the list will be used (under the assumption this is the simplest, but least efficient recipe). The user should also be able mark a certain recipe as the "default" to override this behavior.