From ca8953deb62b042d7e4f2f95abb754b0b4e49d3b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 1 Aug 2016 23:53:48 +0200 Subject: [PATCH] Fix ignore handling, add craft --- init.lua | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 4946312..0dd226d 100644 --- a/init.lua +++ b/init.lua @@ -9,21 +9,22 @@ doc_identifier.identify = function(itemstack, user, pointed_thing) local node = minetest.get_node(pos) if minetest.registered_nodes[node.name] ~= nil then local nodedef = minetest.registered_nodes[node.name] - if(node.name == "ignore") then - return itemstack - end - if doc.entry_exists("nodes", node.name) then - doc.show_entry(username, "nodes", node.name) - else + local show_error = function(username) minetest.show_formspec( username, "doc_identifier:error_missing_node_info", "size[12,2;]label[0,0.2;The identifier was unable to extract information from this block.]button_exit[4.5,1.5;3,1;okay;OK]" ) end + if(node.name == "ignore") then + show_error(username) + end + if doc.entry_exists("nodes", node.name) then + doc.show_entry(username, "nodes", node.name) + else + show_error(username) + end end - else - return itemstack end return itemstack @@ -61,6 +62,14 @@ minetest.register_tool("doc_identifier:identifier_liquid", { on_secondary_use = doc_identifier.solid_mode, }) +minetest.register_craft({ + output = "doc_identifier:identifier_solid", + recipe = { {"group:stick", "group:stick" }, + {"", "group:stick"}, + {"group:stick", ""} } +}) + + minetest.register_alias("doc_identifier:identifier", "doc_identifier:identifier_solid") -- Add documentation