]> git.lizzy.rs Git - Crafter.git/blob - mods/redstone/light.lua
Fix piston crashing game with button or lever
[Crafter.git] / mods / redstone / light.lua
1 minetest.register_node("redstone:light_on", {
2     description = "Redstone Light",
3     tiles = {"redstone_light.png"},
4     drawtype = "normal",
5     light_source = 12,
6     groups = {stone = 1, hard = 1, pickaxe = 1, hand = 4,pathable = 1,redstone_activation=1},
7     sounds = main.stoneSound({
8                 footstep = {name = "glass_footstep", gain = 0.4},
9         dug =  {name = "break_glass", gain = 0.4},
10         }),
11     drop = "redstone:light_off",
12     redstone_activation = function(pos)
13     end,
14     redstone_deactivation = function(pos)
15                 minetest.set_node(pos,{name="redstone:light_off"})
16     end,
17 })
18 minetest.register_node("redstone:light_off", {
19     description = "Redstone Light",
20     tiles = {"redstone_light.png"},
21     drawtype = "normal",
22     groups = {stone = 1, hard = 1, pickaxe = 1, hand = 4,pathable = 1,redstone_activation=1},
23     sounds = main.stoneSound({
24                 footstep = {name = "glass_footstep", gain = 0.4},
25         dug =  {name = "break_glass", gain = 0.4},
26         }),
27     drop = "redstone:light_off",
28     redstone_activation = function(pos)
29                 minetest.set_node(pos,{name="redstone:light_on"})
30     end,
31     redstone_deactivation = function(pos)
32     end,
33 })