1
1
-- The BLINKY_PLANT
2
+ minetest .register_node (" mesecons_blinkyplant:blinky_plant" , {
3
+ drawtype = " plantlike" ,
4
+ visual_scale = 1 ,
5
+ tiles = {" jeija_blinky_plant_off.png" },
6
+ inventory_image = " jeija_blinky_plant_off.png" ,
7
+ walkable = false ,
8
+ groups = {snappy = 3 },
9
+ description = " Deactivated Blinky Plant" ,
10
+ sounds = default .node_sound_leaves_defaults (),
11
+ selection_box = {
12
+ type = " fixed" ,
13
+ fixed = {- 0.3 , - 0.5 , - 0.3 , 0.3 , - 0.5 + 0.7 , 0.3 },
14
+ },
15
+ mesecons = {receptor = {
16
+ state = mesecon .state .off
17
+ }},
18
+ on_punch = function (pos , node , puncher )
19
+ minetest .set_node (pos , {name = " mesecons_blinkyplant:blinky_plant_off" })
20
+ end
21
+ })
2
22
3
23
minetest .register_node (" mesecons_blinkyplant:blinky_plant_off" , {
4
24
drawtype = " plantlike" ,
@@ -7,7 +27,7 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_off", {
7
27
inventory_image = " jeija_blinky_plant_off.png" ,
8
28
paramtype = " light" ,
9
29
walkable = false ,
10
- groups = {dig_immediate = 3 , mesecon = 2 },
30
+ groups = {snappy = 3 , mesecon = 2 },
11
31
description = " Blinky Plant" ,
12
32
sounds = default .node_sound_leaves_defaults (),
13
33
selection_box = {
@@ -16,7 +36,10 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_off", {
16
36
},
17
37
mesecons = {receptor = {
18
38
state = mesecon .state .off
19
- }}
39
+ }},
40
+ on_punch = function (pos , node , puncher )
41
+ minetest .set_node (pos , {name = " mesecons_blinkyplant:blinky_plant" })
42
+ end
20
43
})
21
44
22
45
minetest .register_node (" mesecons_blinkyplant:blinky_plant_on" , {
@@ -26,7 +49,7 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_on", {
26
49
inventory_image = " jeija_blinky_plant_off.png" ,
27
50
paramtype = " light" ,
28
51
walkable = false ,
29
- groups = {dig_immediate = 3 , not_in_creative_inventory = 1 , mesecon = 2 },
52
+ groups = {snappy = 3 , not_in_creative_inventory = 1 , mesecon = 2 },
30
53
drop = " mesecons_blinkyplant:blinky_plant_off 1" ,
31
54
light_source = LIGHT_MAX - 7 ,
32
55
description = " Blinky Plant" ,
@@ -37,7 +60,11 @@ minetest.register_node("mesecons_blinkyplant:blinky_plant_on", {
37
60
},
38
61
mesecons = {receptor = {
39
62
state = mesecon .state .on
40
- }}
63
+ }},
64
+ on_punch = function (pos , node , puncher )
65
+ mesecon :swap_node (pos , " mesecons_blinkyplant:blinky_plant" )
66
+ mesecon :receptor_off (pos )
67
+ end
41
68
})
42
69
43
70
minetest .register_craft ({
0 commit comments