diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-01-09 12:25:33 +0000 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-01-09 12:25:33 +0000 |
commit | ad7b63b86971ccae7b1abc008196c9e9553b54ec (patch) | |
tree | 05fe8e2a0ea0e9b8d4939cffaed46e6abb0cf9f4 /extra.lua | |
parent | 94873618b17859a6f3cc9c3a02dcc88b511075cf (diff) |
Optimize and tidy code.
Diffstat (limited to 'extra.lua')
-rw-r--r-- | extra.lua | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -97,7 +97,7 @@ minetest.register_node("ethereal:glostone", { description = "Glo Stone", tiles = {"glostone.png"}, groups = {cracky = 3}, - light_source = default.LIGHT_MAX - 1, + light_source = 13, drop = "ethereal:glostone", sounds = default.node_sound_stone_defaults(), }) @@ -290,8 +290,9 @@ minetest.register_tool("ethereal:light_staff", { local node = minetest.get_node_or_nil(pos) if node then node = node.name else return end - if node == "default:stone" then - minetest.set_node(pos, {name="ethereal:glostone"}) + if node == "default:stone" + or node == "default:desert_stone" then + minetest.swap_node(pos, {name="ethereal:glostone"}) if not minetest.setting_getbool("creative_mode") then itemstack:add_wear(65535 / 149) -- 150 uses end @@ -318,13 +319,14 @@ minetest.register_on_generated(function(minp, maxp) local bpos for key, pos in pairs(minetest.find_nodes_in_area_under_air(minp, maxp, "default:stone_with_coal")) do bpos = {x = pos.x, y = pos.y + 1, z = pos.z } - if minetest.get_node(bpos).name == "air" then + if math.random(1, 2) == 1 + and minetest.get_node(bpos).name == "air" then if bpos.y > -3000 and bpos.y < -2000 then - minetest.set_node(bpos, {name = "ethereal:illumishroom3"}) + minetest.swap_node(bpos, {name = "ethereal:illumishroom3"}) elseif bpos.y > -2000 and bpos.y < -1000 then - minetest.set_node(bpos, {name = "ethereal:illumishroom2"}) + minetest.swap_node(bpos, {name = "ethereal:illumishroom2"}) elseif bpos.y > -1000 and bpos.y < -30 then - minetest.set_node(bpos, {name = "ethereal:illumishroom"}) + minetest.swap_node(bpos, {name = "ethereal:illumishroom"}) end end end |