From 1a9ae1791e49c7aef381e45daf16f29deed17b61 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Thu, 1 Jan 2015 19:06:04 -0800 Subject: [PATCH] Require input as part of all recipes --- src/data/minecraft/recipes.json | 6 ------ src/scripts/models/recipe_book_parser.coffee | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/data/minecraft/recipes.json b/src/data/minecraft/recipes.json index 38d10b88b..344506fab 100644 --- a/src/data/minecraft/recipes.json +++ b/src/data/minecraft/recipes.json @@ -1134,9 +1134,6 @@ }, { "output": "Pressure Plate (wood)", "input": [[2, "Oak Wood Planks"]] - }, { - "output": "Pufferfish", - "tools": "Fishing Rod" }, { "output": "Pumpkin Pie", "input": ["Egg", "Pumpkin", "Sugar"] @@ -1198,9 +1195,6 @@ "output": "Redstone", "input": ["Redstone Ore", "{furnace fuel}"], "tools": "Furnace" - }, { - "output": "Redstone", - "tools": "Iron Pickaxe" }, { "output": [[9, "Redstone"]], "input": "Block of Redstone" diff --git a/src/scripts/models/recipe_book_parser.coffee b/src/scripts/models/recipe_book_parser.coffee index a784325ad..a2f670294 100644 --- a/src/scripts/models/recipe_book_parser.coffee +++ b/src/scripts/models/recipe_book_parser.coffee @@ -79,8 +79,9 @@ module.exports.V1 = class V1 output = @_parseItemList data.output, field:'output', canBeEmpty:false @_errorLocation = "recipe for #{output[0].name}" - data.input ?= [] + if not data.input? then throw new Error "#{@_errorLocation} is missing input" data.tools ?= [] + input = @_parseItemList data.input, field:'input', canBeEmpty:true tools = @_parseItemList data.tools, field:'tools', canBeEmpty:true