summaryrefslogtreecommitdiff
path: root/init.lua
blob: dc6c70535f8f15c81e4ba5b5c4941b391244bf9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
local S
if minetest.get_modpath("intllib") then
	S = intllib.Getter(minetest.get_current_modname())
else
	S = function(s) return s end
end

minetest.register_craftitem("doc_encyclopedia:encyclopedia", {
	description = S("Encyclopedia"),
	_doc_items_longdesc = S("Allows you to access the help."),
	_doc_items_usagehelp = S("Wield it, then leftclick to access the help."),
	_doc_items_hidden = false,
	stack_max = 1,
	inventory_image = "doc_encyclopedia_encyclopedia.png",
	wield_image = "doc_encyclopedia_encyclopedia.png",
	wield_scale = { x=1, y=1, z=2.25 },
	on_use = function(itemstack, user)
		doc.show_doc(user:get_player_name())
	end,
	groups = { book=1 },
})

minetest.register_craft({
	output = "doc_encyclopedia:encyclopedia",
	recipe = {
		{"group:stick", "group:stick", ""},
		{"group:stick", "", "group:stick"},
		{"group:stick", "group:stick", ""},
	}
})

-- Bonus recipe for Minetest Game
if minetest.get_modpath("default") then
	minetest.register_craft({
		output = "doc_encyclopedia:encyclopedia",
		recipe = {
			{ "default:book" },
			{ "default:book" },
			{ "default:book" },
		}
	})
end

minetest.register_craft({
	type = "fuel",
	recipe = "doc_encyclopedia:encyclopedia",
	burntime = 6,
})