Tweaked staff of Light

This commit is contained in:
tenplus1 2015-06-05 19:58:10 +01:00
parent f43b99fdf0
commit c1e758227d
2 changed files with 8 additions and 11 deletions

View File

@ -258,8 +258,6 @@ minetest.register_node("ethereal:illumishroom3", {
}, },
}) })
local USES = 100
-- Staff of Light (by Xanthin) -- Staff of Light (by Xanthin)
minetest.register_tool("ethereal:light_staff", { minetest.register_tool("ethereal:light_staff", {
description = "Staff of Light", description = "Staff of Light",
@ -283,14 +281,12 @@ minetest.register_tool("ethereal:light_staff", {
if node == "default:stone" then if node == "default:stone" then
minetest.add_node(pos, {name="ethereal:glostone"}) minetest.add_node(pos, {name="ethereal:glostone"})
elseif node == "ethereal:glostone" then
minetest.add_node(pos, {name="default:stone"})
end
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
itemstack:add_wear(65535 / (USES - 1)) itemstack:add_wear(65535 / 99) -- 100 uses
end end
return itemstack return itemstack
end
end, end,
}) })

View File

@ -7,7 +7,8 @@ dofile(minetest.get_modpath("ethereal").."/schematics/apple_tree.lua")
dofile(minetest.get_modpath("ethereal").."/schematics/orange_tree.lua") dofile(minetest.get_modpath("ethereal").."/schematics/orange_tree.lua")
dofile(minetest.get_modpath("ethereal").."/schematics/banana_tree.lua") dofile(minetest.get_modpath("ethereal").."/schematics/banana_tree.lua")
-- Biomes (for 0.4.12 with new changes from Paramat) --= Biomes (Minetest 0.4.12 and above)
if ethereal.icewater == 1 then if ethereal.icewater == 1 then
minetest.register_biome({ minetest.register_biome({
name = "icewater", name = "icewater",
@ -692,8 +693,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
pr = PseudoRandom(seed+1) pr = PseudoRandom(seed+1)
x = pr:next(minp.x + math.floor((divx+0)*divlen), minp.x + math.floor((divx+1)*divlen)) x = pr:next(minp.x + math.floor((divx+0)*divlen), minp.x + math.floor((divx+1)*divlen))
z = pr:next(minp.z + math.floor((divz+0)*divlen), minp.z + math.floor((divz+1)*divlen)) z = pr:next(minp.z + math.floor((divz+0)*divlen), minp.z + math.floor((divz+1)*divlen))
if minetest.get_node({x=x,y=1,z=z}).name == "default:sand" and if minetest.get_node({x=x,y=1,z=z}).name == "default:sand"
minetest.find_node_near({x=x,y=1,z=z}, 1, "default:water_source") then and minetest.find_node_near({x=x,y=1,z=z}, 1, "default:water_source") then
minetest.place_schematic({x=x-4,y=2,z=z-4}, path.."palmtree.mts", 0, '', 0) minetest.place_schematic({x=x-4,y=2,z=z-4}, path.."palmtree.mts", 0, '', 0)
end end
end end