From c1e758227df8cb3462985a6f18911e100b0c3b03 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 5 Jun 2015 19:58:10 +0100 Subject: Tweaked staff of Light --- extra.lua | 12 ++++-------- mapgen_v7n.lua | 7 ++++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/extra.lua b/extra.lua index fd8a9aa..ca8f84e 100644 --- a/extra.lua +++ b/extra.lua @@ -258,8 +258,6 @@ minetest.register_node("ethereal:illumishroom3", { }, }) -local USES = 100 - -- Staff of Light (by Xanthin) minetest.register_tool("ethereal:light_staff", { description = "Staff of Light", @@ -283,14 +281,12 @@ minetest.register_tool("ethereal:light_staff", { if node == "default:stone" then minetest.add_node(pos, {name="ethereal:glostone"}) - elseif node == "ethereal:glostone" then - minetest.add_node(pos, {name="default:stone"}) + if not minetest.setting_getbool("creative_mode") then + itemstack:add_wear(65535 / 99) -- 100 uses + end + return itemstack end - if not minetest.setting_getbool("creative_mode") then - itemstack:add_wear(65535 / (USES - 1)) - end - return itemstack end, }) diff --git a/mapgen_v7n.lua b/mapgen_v7n.lua index aa27e2d..fda3bc3 100644 --- a/mapgen_v7n.lua +++ b/mapgen_v7n.lua @@ -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/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 minetest.register_biome({ name = "icewater", @@ -692,8 +693,8 @@ minetest.register_on_generated(function(minp, maxp, seed) pr = PseudoRandom(seed+1) 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)) - if minetest.get_node({x=x,y=1,z=z}).name == "default:sand" and - minetest.find_node_near({x=x,y=1,z=z}, 1, "default:water_source") then + if minetest.get_node({x=x,y=1,z=z}).name == "default:sand" + 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) end end -- cgit v1.2.3