Bug: Make sure mod recipes for MC items show up

This fixes a regression where recipes for vanilla Minecraft items
(e.g., Iron Ingot) added by mods (e.g., Pulverized Iron to Iron
Ingot) didn't show up on that item's detail page.
This commit is contained in:
Andrew Miner
2015-03-11 22:17:17 -07:00
parent b9ced9b3d1
commit 35e3712783
3 changed files with 4 additions and 3 deletions
@@ -25,7 +25,7 @@ module.exports = class ModParserV1 extends CommandParserVersionBase
_command_author: (authorParts...)->
if @_rawData.author? then throw new Error 'duplicate declaration of "author"'
author = authorParts.join ''
author = authorParts.join ', '
if author.length is 0 then throw new Error '"author" cannot be empty, but may be omitted'
@_rawData.author = author
@@ -153,7 +153,7 @@ module.exports = class ModVersionParserV1 extends CommandParserVersionBase
createSlug = (name)=>
item = @_rawData.items[name]
if item?
if item? and item.type isnt 'update'
slug = new ItemSlug modVersion.modSlug, _.slugify name
else
slug = new ItemSlug _.slugify name
@@ -198,6 +198,7 @@ module.exports = class ModVersionParserV1 extends CommandParserVersionBase
pattern: recipeData.pattern
tools: toolStacks
logger.debug "adding recipe: #{recipe}"
modVersion.addRecipe recipe
return recipe
+1 -1
View File
@@ -107,7 +107,7 @@ module.exports = class Recipe extends BaseModel
@_produces[stack.itemSlug.qualified] = true
@_produces[stack.itemSlug.item] = true
return @_produces[itemSlug.qualified]
return @_produces[itemSlug.qualified] or @_produces[itemSlug.item]
requires: (itemSlug)->
for stack in @input