From 078a998d2969fbdcd4fd3657ee286b7922b0e160 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Wed, 12 Sep 2018 20:26:23 -0400 Subject: append `output` given to color craft helper if prefix/suffix are used (if any; allows specifying an item count/yield for the recipe) --- init.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 1be45c4..09b156f 100644 --- a/init.lua +++ b/init.lua @@ -265,18 +265,19 @@ local function register_c(craft, hue, sat, val) recipe = string.gsub(recipe, "NEUTRAL_NODE", craft.neutral_node) local newrecipe = minetest.deserialize(recipe) - local output = craft.output + local coutput = craft.output or "" + local output = coutput if craft.output_prefix then if craft.palette ~= "split" then - output = craft.output_prefix..color..craft.output_suffix + output = craft.output_prefix..color..craft.output_suffix..coutput else if hue == "white" or hue == "black" or string.find(hue, "grey") then - output = craft.output_prefix.."grey"..craft.output_suffix + output = craft.output_prefix.."grey"..craft.output_suffix..coutput elseif hue == "pink" then dye = "dye:light_red" - output = craft.output_prefix.."red"..craft.output_suffix + output = craft.output_prefix.."red"..craft.output_suffix..coutput else - output = craft.output_prefix..hue..craft.output_suffix + output = craft.output_prefix..hue..craft.output_suffix..coutput end end end -- cgit v1.2.3