summaryrefslogtreecommitdiff
path: root/extra.lua
diff options
context:
space:
mode:
authortenplus1 <kinsellaja@yahoo.com>2015-02-04 10:26:48 +0000
committertenplus1 <kinsellaja@yahoo.com>2015-02-04 10:26:48 +0000
commite18a5e913a0ed6f10668ac6b9051980259c5d087 (patch)
tree605d142c7c6b4375059013fb658b01e4edef73c9 /extra.lua
parent741504fbf3be92017e705fe7eb34ebe786403912 (diff)
Update: add light staff and change crystal usage
Diffstat (limited to 'extra.lua')
-rw-r--r--extra.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/extra.lua b/extra.lua
index c6c6a31..f499643 100644
--- a/extra.lua
+++ b/extra.lua
@@ -264,6 +264,48 @@ minetest.register_node("ethereal:illumishroom3", {
},
})
+local USES = 100
+
+-- Staff of Light (by Xanthin)
+minetest.register_tool("ethereal:light_staff", {
+ description = "Staff of Light",
+ inventory_image = "light_staff.png",
+ stack_max = 1,
+ on_use = function(itemstack, user, pointed_thing)
+
+ local pos = pointed_thing.under
+
+ if pointed_thing.type ~= "node" then return end
+
+ if minetest.is_protected(pos, user:get_player_name()) then
+ minetest.record_protection_violation(pos, user:get_player_name())
+ return
+ end
+
+ local node = minetest.get_node(pos).name
+
+ if node == "default:stone" then
+ minetest.env:add_node(pos, {name="ethereal:glostone"})
+ elseif node == "ethereal:glostone" then
+ minetest.env:add_node(pos, {name="default:stone"})
+ end
+
+ if not minetest.setting_getbool("creative_mode") then
+ itemstack:add_wear(65535 / (USES - 1))
+ end
+ return itemstack
+ end,
+})
+
+minetest.register_craft({
+ output = "ethereal:light_staff",
+ recipe = {
+ {"ethereal:illumishroom", "default:mese_crystal", "ethereal:illumishroom"},
+ {"ethereal:illumishroom2", "default:steel_ingot", "ethereal:illumishroom2"},
+ {"ethereal:illumishroom3", "default:steel_ingot", "ethereal:illumishroom3"}
+ }
+})
+
-- Generate Illumishroom in caves next to coal
minetest.register_on_generated(function(minp, maxp, seed)