2 minetest
.register_node("mesecons_blinkyplant:blinky_plant", {
3 drawtype
= "plantlike",
6 tiles
= {"jeija_blinky_plant_off.png"},
7 inventory_image
= "jeija_blinky_plant_off.png",
9 groups
= {dig_immediate
=3, not_in_creative_inventory
=1},
10 drop
="mesecons_blinkyplant:blinky_plant_off 1",
11 description
="Deactivated Blinky Plant",
12 sounds
= hades_sounds
.node_sound_leaves_defaults(),
15 fixed
= {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3},
17 mesecons
= {receptor
= {
18 state
= mesecon
.state
.off
20 on_rightclick
= function(pos
, node
, clicker
)
21 minetest
.set_node(pos
, {name
="mesecons_blinkyplant:blinky_plant_off"})
25 minetest
.register_node("mesecons_blinkyplant:blinky_plant_off", {
26 drawtype
= "plantlike",
28 tiles
= {"jeija_blinky_plant_off.png"},
29 inventory_image
= "jeija_blinky_plant_off.png",
32 groups
= {dig_immediate
=3, mesecon
=2},
33 description
="Blinky Plant",
34 sounds
= hades_sounds
.node_sound_leaves_defaults(),
37 fixed
= {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3},
39 mesecons
= {receptor
= {
40 state
= mesecon
.state
.off
42 on_rightclick
= function(pos
, node
, clicker
)
43 minetest
.set_node(pos
, {name
="mesecons_blinkyplant:blinky_plant"})
47 minetest
.register_node("mesecons_blinkyplant:blinky_plant_on", {
48 drawtype
= "plantlike",
50 tiles
= {"jeija_blinky_plant_on.png"},
51 inventory_image
= "jeija_blinky_plant_off.png",
54 groups
= {dig_immediate
=3, not_in_creative_inventory
=1, mesecon
=2},
55 drop
="mesecons_blinkyplant:blinky_plant_off 1",
56 light_source
= minetest
.LIGHT_MAX
-7,
57 description
= "Blinky Plant",
58 sounds
= hades_sounds
.node_sound_leaves_defaults(),
61 fixed
= {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3},
63 mesecons
= {receptor
= {
64 state
= mesecon
.state
.on
66 on_rightclick
= function(pos
, node
, clicker
)
67 minetest
.set_node(pos
, {name
= "mesecons_blinkyplant:blinky_plant"})
68 mesecon
:receptor_off(pos
)
72 minetest
.register_craft({
73 output
= "mesecons_blinkyplant:blinky_plant_off 1",
75 {"","group:mesecon_conductor_craftable",""},
76 {"","group:mesecon_conductor_craftable",""},
77 {"group:sapling","group:sapling","group:sapling"},
81 minetest
.register_abm({
82 label
= "Blink blinky plant on",
83 nodenames
= {"mesecons_blinkyplant:blinky_plant_off"},
84 interval
= BLINKY_PLANT_INTERVAL
,
86 action
= function(pos
, node
, active_object_count
, active_object_count_wider
)
87 --minetest.remove_node(pos)
88 minetest
.add_node(pos
, {name
="mesecons_blinkyplant:blinky_plant_on"})
89 minetest
.check_for_falling(pos
)
90 mesecon
:receptor_on(pos
)
94 minetest
.register_abm({
95 label
= "Blink blinky plant off",
96 nodenames
= {"mesecons_blinkyplant:blinky_plant_on"},
97 interval
= BLINKY_PLANT_INTERVAL
,
99 action
= function(pos
, node
, active_object_count
, active_object_count_wider
)
100 --minetest.remove_node(pos)
101 minetest
.add_node(pos
, {name
="mesecons_blinkyplant:blinky_plant_off"})
102 minetest
.check_for_falling(pos
)
103 mesecon
:receptor_off(pos
)