From ccad705dfb26d20f395ed2ff0b74eb948598e997 Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Fri, 22 Nov 2019 13:18:14 +0100 Subject: [PATCH] add "disable_recipe" flag to castle_shields.register_shield() --- shield_functions.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shield_functions.lua b/shield_functions.lua index d32938b..83566f8 100644 --- a/shield_functions.lua +++ b/shield_functions.lua @@ -1,4 +1,4 @@ -castle_shields.register_shield = function(name, desc, background_color, foreground_color, mask) +castle_shields.register_shield = function(name, desc, background_color, foreground_color, mask, disable_recipe) local tile_side = "castle_shield_"..background_color..".png" local tile_front = "castle_shield_"..background_color..".png^(castle_shield_"..foreground_color..".png^[mask:castle_shield_mask_"..mask..".png)" @@ -28,6 +28,11 @@ castle_shields.register_shield = function(name, desc, background_color, foregrou }, }) + if disable_recipe then + -- recipe disabled by caller + return + end + minetest.register_craft({ output = minetest.get_current_modname()..":"..name, recipe = { @@ -36,4 +41,4 @@ castle_shields.register_shield = function(name, desc, background_color, foregrou {"dye:"..background_color, "default:steel_ingot", "dye:"..foreground_color}, } }) -end \ No newline at end of file +end