Major updates to the crafting algo.

* Update crafting algo. to favor highest output recipes for making
  items, and to be more flexible about trying a variety of recipes if
  some one recipe doesn't work.
* Modify crafting algo. to allow crafting of "gatherable" items.
* Update logger to support indent/outdent for clearer formatting
* Convert IC2 Forge Hammer / Cutter recipes to treat them as tools
This commit is contained in:
Andrew Miner
2015-02-18 21:29:21 -08:00
parent aab3baec1a
commit b1a6637005
6 changed files with 148 additions and 111 deletions
+4 -8
View File
@@ -84,14 +84,10 @@ module.exports = class ModPack extends BaseModel
findRecipes: (itemSlug, result=[])->
return null unless itemSlug?
if itemSlug.isQualified
mod = @getMod itemSlug.mod
if mod? then mod.findRecipes itemSlug, result
if result.length is 0
for mod in @_mods
continue unless mod.enabled
mod.findRecipes itemSlug, result
for mod in @_mods
continue unless mod.enabled
continue if itemSlug.isQualified and itemSlug.mod isnt mod.slug
mod.findRecipes itemSlug, result
result.sort (a, b)-> Recipe.compareFor a, b, itemSlug