From 4bff4e99edcce62ca991d49c337a065251137964 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 1 Apr 2020 05:24:59 +0200 Subject: [PATCH] Anvilguide: Select proper ingot if change material --- mods/anvil/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/anvil/init.lua b/mods/anvil/init.lua index b3b6c58..2be0351 100644 --- a/mods/anvil/init.lua +++ b/mods/anvil/init.lua @@ -371,10 +371,12 @@ realtest.show_craft_guide_anvil = function( player, formname, fields) end local material local mtypes = { "a", "m", "i" } -- anvil, metal, instrument + local material_button_pressed = false for m=1, #metals.list do for _,t in pairs(mtypes) do if fields[t.."material_"..metals.list[m]] then material = metals.list[m] + material_button_pressed = true break end end @@ -392,6 +394,10 @@ realtest.show_craft_guide_anvil = function( player, formname, fields) for i, v in ipairs(realtest.registered_anvil_recipes ) do if( v and v.output and fields[ v.output ]) then nr = i; + break + elseif( material_button_pressed and v and v.material and material == v.material) then + nr = i; + break end end local plan = realtest.registered_anvil_recipes[ nr ];