From 783a84d3c6aa665aab8fb9927726e37e1b7c477f Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 17 Dec 2018 19:15:28 +0100 Subject: [PATCH] Define custom recipe's width inside craft declaration --- README.md | 6 +++--- init.lua | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 536a1e5..00e6054 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,8 @@ Use the command `/craft` to show the recipe(s) of the pointed node. #### Registering a custom crafting type #### ```Lua craftguide.register_craft_type("digging", { - description = S("Digging"), - icon = "default_tool_steelpick.png", - width = 1, + description = "Digging", + icon = "default_tool_steelpick.png", }) ``` @@ -30,6 +29,7 @@ craftguide.register_craft_type("digging", { ```Lua craftguide.register_craft({ type = "digging", + width = 1, output = "default:cobble 2", items = {"default:stone"}, }) diff --git a/init.lua b/init.lua index b55e57f..1f245f5 100644 --- a/init.lua +++ b/init.lua @@ -55,8 +55,7 @@ end craftguide.register_craft_type("digging", { description = S("Digging"), - icon = "default_tool_steelpick.png", - width = 1, + icon = "default_tool_steelpick.png", }) function craftguide.register_craft(def) @@ -65,6 +64,7 @@ end craftguide.register_craft({ type = "digging", + width = 1, output = "default:cobble", items = {"default:stone"}, }) @@ -476,8 +476,8 @@ local function add_custom_recipes(item, recipes) local craft = craftguide.custom_crafts[j] if craft.output:match("%S*") == item then recipes[#recipes + 1] = { - width = craftguide.craft_types[craft.type].width, type = craft.type, + width = craft.width, items = craft.items, output = craft.output, }