@@ -52,11 +52,15 @@ end return {} end local modofname = function(id) - local sep = string.find(id,':') - if sep == nil then return nil end -- uh oh - return string.sub(id, 1, sep - 1) + local item = minetest.registered_nodes[id] + if item == nil or item.mod_origin == '??' or not item.mod_origin then + local sep = string.find(id,':') + if sep == nil then return nil end -- uh oh + return string.sub(id, 1, sep - 1) + end + return item.mod_origin end local item_restrict_eval = function(name, restrict) for _,n in pairs(constants.exclude_names) do if string.find(name,n) ~= nil then @@ -280,9 +284,9 @@ grind = { name = 'Milling Guide'; node = 'sorcery:mill'; booksuf = 'Manual'; - chance = 1; + chance = 4; w = 1, h = 2; pick = function(restrict) cache:populate_grindables() if restrict then @@ -327,17 +331,14 @@ end end end; }; - -- wand = { - -- booksuf = 'Grimoire'; - -- } enchant = { name = 'Enchantment Matrix'; node = 'sorcery:enchanter'; booksuf = 'Grimoire'; drawslots = false; - chance = 6; + chance = 4; w = 2, h = 2; pick = function(restrict) -- TODO make sure affinity restrictions match local names = {} @@ -457,12 +458,17 @@ local x, y = k.slots[i][1], k.slots[i][2] if ing and ing ~= '' then local tt if k.indesc then tt = k.indesc(ing) else tt = desc_builtin(ing) end + local overlay = '' + if minetest.get_item_group(ing, 'sorcery_extract') ~= 0 then + overlay = string.format('item_image[%f,%f;0.6,0.6;%s]', x+0.5, y+0.5, ing) + ing = minetest.registered_nodes[ing]._sorcery.extract.of + end t = t .. string.format([[ - item_image[%f,%f;1,1;%s] + item_image[%f,%f;1,1;%s]%s tooltip[%f,%f;1,1;%s] - ]], x,y, minetest.formspec_escape(group_eval(ing)), + ]], x,y, minetest.formspec_escape(group_eval(ing)), overlay, x,y, minetest.formspec_escape(tt)) else if k.drawslots == nil or k.drawslots then t = string.format('box[%f,%f;0.1,0.1;#00000060]',x+0.45,y+0.45) .. t