summaryrefslogtreecommitdiff
path: root/trafficlight/pole.lua
blob: a8815fc8371049e4f6df9ef01891bbd756c4faf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--[[
	StreetsMod: inDev Trafficlights
]]
local rules_pole = {
    {x= 0, y= 0, z=-1},
    {x= 1, y= 0, z= 0},
    {x=-1, y= 0, z= 0},
    {x= 0, y= 0, z= 1},
    {x= 1, y= 1, z= 0},
    {x= 1, y=-1, z= 0},
    {x=-1, y= 1, z= 0},
    {x=-1, y=-1, z= 0},
    {x= 0, y= 1, z= 1},
    {x= 0, y=-1, z= 1},
    {x= 0, y= 1, z=-1},
    {x= 0, y=-1, z=-1},
    {x= 0, y=-1, z= 0},
    {x= 0, y= 1, z= 0}
}

minetest.register_node(":streets:bigpole", {
	description = "Pole",
	paramtype = "light",
	paramtype2 = "facedir",
	drawtype = "nodebox",
	tiles = {"streets_pole.png"},
	groups = {cracky = 1, level = 2, bigpole = 1},
	node_box = {
		type = "fixed",
		fixed = {
			{-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
		}
	},
	on_place = minetest.rotate_node,
	digiline = {
		wire = {
			rules = rules_pole
		}
	}
})
minetest.register_node(":streets:bigpole_edge", {
	drop = "streets:bigpole",
	paramtype = "light",
	paramtype2 = "facedir",
	drawtype = "nodebox",
	tiles = {"streets_pole.png"},
	groups = {cracky = 1, level = 2, not_in_creative_inventory = 1, bigpole = 1},
	node_box = {
		type = "fixed",
		fixed = {
			{-0.15,-0.5,-0.15,0.15,0.15,0.15},
			{-0.15,-0.15,-0.125,0.15,0.15,-0.5}
		}
	},
})