Fix ignore handling, add craft
This commit is contained in:
parent
77188f55e8
commit
ca8953deb6
25
init.lua
25
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user