diff options
| -rw-r--r-- | crystal.lua | 2 | ||||
| -rw-r--r-- | extra.lua | 42 | ||||
| -rw-r--r-- | flowers.lua | 22 | ||||
| -rw-r--r-- | init.lua | 2 | ||||
| -rw-r--r-- | textures/light_staff.png | bin | 0 -> 361 bytes | 
5 files changed, 55 insertions, 13 deletions
| diff --git a/crystal.lua b/crystal.lua index d8fcc73..300f07d 100644 --- a/crystal.lua +++ b/crystal.lua @@ -27,7 +27,7 @@ minetest.register_craft({  	output = "ethereal:crystal_ingot",  	recipe = {  		{"default:mese_crystal", "ethereal:crystal_spike", ""}, -		{"", "", ""}, +		{"ethereal:crystal_spike", "default:mese_crystal", ""},  		{"", "", ""},  	}  }) @@ -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) diff --git a/flowers.lua b/flowers.lua index d52e36a..413456f 100644 --- a/flowers.lua +++ b/flowers.lua @@ -2,8 +2,8 @@  minetest.register_abm({  	nodenames = {"group:flora"},  	neighbors = {"group:soil"}, -	interval = 40, -	chance = 20, +	interval = 50, +	chance = 25,  	action = function(pos, node)  		local light = minetest.get_node_light(pos) @@ -17,15 +17,15 @@ minetest.register_abm({  		if #minetest.find_nodes_in_area(pos0, pos1, "group:flora") > 3 then -			local crystal = minetest.find_nodes_in_area(pos0, pos1, {"ethereal:crystalgrass"}) -			local frost = minetest.find_nodes_in_area(pos0, pos1, {"ethereal:frost_tree"}) -			if #crystal > 6 and #frost > 7 then -				local ppos = crystal[1] -				ppos.y = ppos.y - 1 -				local nod = minetest.get_node(ppos).name -				ppos.y = ppos.y + 1 -				if nod == "ethereal:crystal_dirt" then -					minetest.set_node(crystal[1], {name="ethereal:crystal_spike"}) +			local grass = minetest.find_nodes_in_area(pos0, pos1, {"ethereal:crystalgrass"}) +			local crystal = minetest.find_nodes_in_area(pos0, pos1, {"ethereal:crystal_spike"}) + +			if #grass > 6 and #crystal < 1 then +				grass = grass[math.random(#grass)] +				grass.y = grass.y - 1 +				if minetest.get_node(grass).name == "ethereal:crystal_dirt" then +					grass.y = grass.y + 1 +					minetest.set_node(grass, {name="ethereal:crystal_spike"})  				end  			end @@ -1,6 +1,6 @@  --[[
 -	Minetest Ethereal Mod 1.14 (20th Jan 2015)
 +	Minetest Ethereal Mod 1.14 (4th Feb 2015)
  	Created by ChinChow
 diff --git a/textures/light_staff.png b/textures/light_staff.pngBinary files differ new file mode 100644 index 0000000..983a3dc --- /dev/null +++ b/textures/light_staff.png | 
