diff options
| author | VanessaE <vanessaezekowitz@gmail.com> | 2013-11-29 14:44:51 -0800 | 
|---|---|---|
| committer | VanessaE <vanessaezekowitz@gmail.com> | 2013-11-29 14:44:51 -0800 | 
| commit | 2d0ff5e2ac214074c38c7c442f62916272b3981e (patch) | |
| tree | fbefab3101815e540ff19d8034576a9c74b0fb1b /mesecons_blinkyplant | |
| parent | 9ab0d9deb2ac0801f38b9291ef8c8e3fb6ef5745 (diff) | |
| parent | 33de6fad55f679e288157ebc6a885cd7e6a4f817 (diff) | |
Merge pull request #124 from qwrwed/master
Make blinkyplants toggleable
Diffstat (limited to 'mesecons_blinkyplant')
| -rw-r--r-- | mesecons_blinkyplant/init.lua | 35 | 
1 files changed, 31 insertions, 4 deletions
diff --git a/mesecons_blinkyplant/init.lua b/mesecons_blinkyplant/init.lua index 8908d33..edaa547 100644 --- a/mesecons_blinkyplant/init.lua +++ b/mesecons_blinkyplant/init.lua @@ -1,4 +1,24 @@  -- The BLINKY_PLANT +minetest.register_node("mesecons_blinkyplant:blinky_plant", { +	drawtype = "plantlike", +	visual_scale = 1, +	tiles = {"jeija_blinky_plant_off.png"}, +	inventory_image = "jeija_blinky_plant_off.png", +	walkable = false, +	groups = {snappy=3}, +    description="Deactivated Blinky Plant", +	sounds = default.node_sound_leaves_defaults(), +	selection_box = { +		type = "fixed", +		fixed = {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3}, +	}, +	mesecons = {receptor = { +		state = mesecon.state.off +	}}, +	on_punch = function(pos, node, puncher) +        minetest.set_node(pos, {name="mesecons_blinkyplant:blinky_plant_off"}) +    end	 +})  minetest.register_node("mesecons_blinkyplant:blinky_plant_off", {  	drawtype = "plantlike", @@ -7,7 +27,7 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_off", {  	inventory_image = "jeija_blinky_plant_off.png",  	paramtype = "light",  	walkable = false, -	groups = {dig_immediate=3, mesecon = 2}, +	groups = {snappy=3, mesecon = 2},      	description="Blinky Plant",  	sounds = default.node_sound_leaves_defaults(),  	selection_box = { @@ -16,7 +36,10 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_off", {  	},  	mesecons = {receptor = {  		state = mesecon.state.off -	}} +	}}, +	on_punch = function(pos, node, puncher) +        minetest.set_node(pos, {name="mesecons_blinkyplant:blinky_plant"}) +    end  })  minetest.register_node("mesecons_blinkyplant:blinky_plant_on", { @@ -26,7 +49,7 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_on", {  	inventory_image = "jeija_blinky_plant_off.png",  	paramtype = "light",  	walkable = false, -	groups = {dig_immediate=3, not_in_creative_inventory=1, mesecon = 2}, +	groups = {snappy=3, not_in_creative_inventory=1, mesecon = 2},  	drop="mesecons_blinkyplant:blinky_plant_off 1",  	light_source = LIGHT_MAX-7,  	description = "Blinky Plant", @@ -37,7 +60,11 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_on", {  	},  	mesecons = {receptor = {  		state = mesecon.state.on -	}} +	}}, +	on_punch = function(pos, node, puncher) +	mesecon:swap_node(pos, "mesecons_blinkyplant:blinky_plant") +	mesecon:receptor_off(pos) +	end  })  minetest.register_craft({  | 
