From 2729d8ff6d2f3cfd0ad2edb07de1f2932caa4f79 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sun, 2 Apr 2017 15:49:04 -0600 Subject: [PATCH] generalize the rope-crafting recipe --- crafts.lua | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/crafts.lua b/crafts.lua index 299c0cc..4758ae0 100644 --- a/crafts.lua +++ b/crafts.lua @@ -3,16 +3,24 @@ local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") if minetest.get_modpath("farming") then - minetest.register_craft({ - output = 'ropes:ropesegment', - recipe = { - {'farming:cotton','farming:cotton'}, - {'farming:cotton','farming:cotton'}, - {'farming:cotton','farming:cotton'} - } - }) + local old_def = minetest.registered_craftitems["farming:cotton"] + if old_def then + old_def.groups["thread"] = 1 + minetest.override_item("farming:cotton", { + groups = old_def.groups + }) + end end +minetest.register_craft({ + output = 'ropes:ropesegment', + recipe = { + {'group:thread','group:thread'}, + {'group:thread','group:thread'}, + {'group:thread','group:thread'}, + } +}) + minetest.register_craftitem("ropes:ropesegment", { description = S("Rope Segment"), _doc_items_longdesc = ropes.doc.ropesegment_longdesc,