sorcery  Diff

Differences From Artifact [8701b2357d]:

To Artifact [b1bce87867]:


    35     35   	local ink = i:get_stack('ink',1)
    36     36   	local pen = i:get_stack('pen',1)
    37     37   
    38     38   	local ink_count = ink:get_count()
    39     39   	
    40     40   	local maxrecs = math.min(ink_count, paper:get_count(), item:get_count())
    41     41   	if pen:is_empty() then maxrecs = 0 end
    42         -
    43         -	if maxrecs > 0 and sorcery.cookbook.classes.craft.find(item:get_name()) then
    44         -		local rec = ItemStack{name = 'sorcery:recipe', count = maxrecs}
    45         -		sorcery.cookbook.setrecipe(rec, 'craft', item:get_name())
    46         -		i:set_stack('output',1,rec)
    47         -	else
           42  +	local found = false
           43  +	if maxrecs > 0 then
           44  +		for _, meth in pairs {'craft','lathe','grind'} do
           45  +			if sorcery.cookbook.classes[meth].find(item:get_name()) then
           46  +				local rec = ItemStack{name = 'sorcery:recipe', count = maxrecs}
           47  +				sorcery.cookbook.setrecipe(rec, meth, item:get_name())
           48  +				i:set_stack('output',1,rec)
           49  +				found = true
           50  +				break
           51  +			end
           52  +		end
           53  +	end
           54  +	if not found then
    48     55   		i:set_stack('output',1,ItemStack())
    49     56   	end
    50     57   	disassembler_formspec(pos)
    51     58   end
    52     59   local dsbox = {
    53     60   	type = 'fixed';
    54     61   	fixed = {