4 local conv
= function(pos
)
5 local nodename
= minetest
.get_node(pos
).name
6 if nodename
== "default:ash" or nodename
== "default:fertile_sand" or nodename
== "default:stone_baked" or nodename
== "default:stone" or nodename
== "default:cobble" or nodename
== "default:mossystone" or nodename
== "default:tuff" or nodename
== "default:tuff_baked" or nodename
== "default:mossytuff" or nodename
== "default:mossycobble" then
7 -- minetest.remove_node(pos)
8 minetest
.set_node(pos
, {name
="default:dirt"})
9 minetest
.check_for_falling(pos
)
13 cotrig
= function(pos
)
21 if math
.abs(dx
)<4 and math
.abs(dy
)<1 and math
.abs(dz
)<4 then
32 function staffgaia
.staff_on_use(itemstack
, user
, pointed_thing
, uses
)
33 local pt
= pointed_thing
34 -- check if pointing at a node
38 if pt
.type ~= "node" then
43 local under
= minetest
.get_node(pt
.under
)
44 local p
= {x
=pt
.under
.x
, y
=pt
.under
.y
+1, z
=pt
.under
.z
}
45 local above
= minetest
.get_node(p
)
48 -- return if any of the nodes is not registered
49 if not minetest
.registered_nodes
[under
.name
] then
52 if not minetest
.registered_nodes
[above
.name
] then
57 -- check if the node above the pointed thing is air
58 if above
.name
~= "air" then
64 if not minetest
.settings
:get_bool("creative_mode") then
65 itemstack
:add_wear(65535/(uses
-1))
70 minetest
.register_tool("staffgaia:staff", {
71 description
= "Staff of Gaia",
72 inventory_image
= "staff_of_gaia.png",
75 on_use
= function(itemstack
, user
, pointed_thing
)
76 return staffgaia
.staff_on_use(itemstack
, user
, pointed_thing
, 99)
80 minetest
.register_craftitem("staffgaia:head", {
81 description
= "Head of the Staff of Gaia",
82 inventory_image
= "staffgaia_head.png",
85 minetest
.register_craftitem("staffgaia:shaft", {
86 description
= "Shaft of the Staff of Gaia",
87 inventory_image
= "staffgaia_shaft.png",
90 minetest
.register_craft({
91 output
= "staffgaia:head",
93 {"default:sapphire", "default:mese_crystal", "default:sapphire"},
94 {"default:mese_crystal", "default:diamond", "default:mese_crystal"},
95 {"default:emerald", "default:mese_crystal", "default:emerald"},
99 minetest
.register_craft({
100 output
= "staffgaia:shaft",
102 {"", "default:ruby", ""},
103 {"", "default:ruby", ""},
104 {"", "default:tree", ""},
107 minetest
.register_craft({
108 output
= "staffgaia:staff",
110 {"", "staffgaia:head", ""},
111 {"", "staffgaia:shaft", ""},