diff --git a/api_craft_guide.lua b/api_craft_guide.lua index c321a1c..cee1290 100644 --- a/api_craft_guide.lua +++ b/api_craft_guide.lua @@ -324,7 +324,7 @@ craft_guide.create_detached_inventory = function() return -1 end, allow_take = function(inv, listname, index, stack, player) - return -1 + return 0 end, on_move = function(inv, from_list, from_index, to_list, to_index, count, player) end, @@ -334,21 +334,10 @@ craft_guide.create_detached_inventory = function() end, }) - --[[ - local craft_guide_list = {} - for name,def in pairs(minetest.registered_items) do - local craft_recipe = minetest.get_craft_recipe(name); - if craft_recipe.items ~= nil then - if (not def.groups.not_in_craft_guide or def.groups.not_in_craft_guide == 0) - --and (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) - and def.description and def.description ~= "" then - table.insert(craft_guide_list, name) - end - end - end - ]]-- local craft_guide_list = {} for name,def in pairs(minetest.registered_items) do + -- local craft_recipe = minetest.get_craft_recipe(name); + -- if craft_recipe.items ~= nil then local craft = craft_guide.crafts[name]; if craft ~= nil then if (not def.groups.not_in_craft_guide or def.groups.not_in_craft_guide == 0) diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..e69de29 diff --git a/register_node.lua b/register_node.lua index 3898d38..c6f12bd 100644 --- a/register_node.lua +++ b/register_node.lua @@ -34,7 +34,6 @@ minetest.register_node("craft_guide:sign_wall", { if from_list == to_list then return count end - --print("allow_metadata_inventory_move to list: "..to_list) if to_list == "output" or to_list == "bookmark" then local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() @@ -47,16 +46,12 @@ minetest.register_node("craft_guide:sign_wall", { return 0 end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) - --print("allow_metadata_inventory_put to list: "..listname) if listname == "bookmark" then - return 1 + minetest.env:get_meta(pos):get_inventory():set_stack(listname,index,stack) end if listname == "output" then local meta = minetest.env:get_meta(pos) - if listname == "output" then - craft_guide.update_recipe(meta, player, stack) - return 0 - end + craft_guide.update_recipe(meta, player, stack) end return 0 end, @@ -103,7 +98,6 @@ minetest.register_node("craft_guide:lcd_pc", { if from_list == to_list then return count end - --print("allow_metadata_inventory_move to list: "..to_list) if to_list == "output" or to_list == "bookmark" then local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() @@ -116,7 +110,6 @@ minetest.register_node("craft_guide:lcd_pc", { return 0 end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) - --print("allow_metadata_inventory_put to list: "..listname) if listname == "bookmark" then return 1 end