|
| 1 | +local lightstone_rules = { |
| 2 | + {x=0, y=0, z=-1}, |
| 3 | + {x=1, y=0, z=0}, |
| 4 | + {x=-1, y=0, z=0}, |
| 5 | + {x=0, y=0, z=1}, |
| 6 | + {x=1, y=1, z=0}, |
| 7 | + {x=1, y=-1, z=0}, |
| 8 | + {x=-1, y=1, z=0}, |
| 9 | + {x=-1, y=-1, z=0}, |
| 10 | + {x=0, y=1, z=1}, |
| 11 | + {x=0, y=-1, z=1}, |
| 12 | + {x=0, y=1, z=-1}, |
| 13 | + {x=0, y=-1, z=-1}, |
| 14 | + {x=0, y=-1, z=0}, |
| 15 | +} |
| 16 | + |
1 | 17 | function mesecon:lightstone_add(name, base_item, texture_off, texture_on) |
2 | 18 | minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_off", { |
3 | | - tiles = {texture_off}, |
4 | | - groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2}, |
5 | | - description=name.." Lightstone", |
6 | | - sounds = default.node_sound_stone_defaults(), |
7 | | - mesecons = {effector = { |
8 | | - action_on = function (pos, node) |
9 | | - minetest.swap_node(pos, {name = "mesecons_lightstone:lightstone_" .. name .. "_on", param2 = node.param2}) |
10 | | - end |
11 | | - }} |
12 | | - }) |
| 19 | + tiles = {texture_off}, |
| 20 | + groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2}, |
| 21 | + description=name.." Lightstone", |
| 22 | + sounds = default.node_sound_stone_defaults(), |
| 23 | + mesecons = {effector = { |
| 24 | + rules = lightstone_rules, |
| 25 | + action_on = function (pos, node) |
| 26 | + minetest.swap_node(pos, {name = "mesecons_lightstone:lightstone_" .. name .. "_on", param2 = node.param2}) |
| 27 | + end, |
| 28 | + }} |
| 29 | + }) |
13 | 30 | minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_on", { |
14 | 31 | tiles = {texture_on}, |
15 | 32 | groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2}, |
16 | 33 | drop = "mesecons_lightstone:lightstone_" .. name .. "_off", |
17 | 34 | light_source = LIGHT_MAX-2, |
18 | 35 | sounds = default.node_sound_stone_defaults(), |
19 | 36 | mesecons = {effector = { |
| 37 | + rules = lightstone_rules, |
20 | 38 | action_off = function (pos, node) |
21 | 39 | minetest.swap_node(pos, {name = "mesecons_lightstone:lightstone_" .. name .. "_off", param2 = node.param2}) |
22 | | - end |
| 40 | + end, |
23 | 41 | }} |
24 | 42 | }) |
25 | 43 |
|
|
0 commit comments