summaryrefslogtreecommitdiff
path: root/infrastructure/advanced_aircraft_warning_light.lua
blob: c46edd491d3a1236f32deee3c8629e65a80b832f (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
-- Aircraft warning light
	minetest.register_abm( {
		nodenames = {"infrastructure:aircraft_warning_light_bright", "infrastructure:aircraft_warning_light_dark"},
		interval = 2,
		chance = 1,
		action = function(pos, node)
			local node = minetest.env:get_node(pos)
			if node.name == "infrastructure:aircraft_warning_light_bright" then
				minetest.swap_node(pos, {name = "infrastructure:aircraft_warning_light_dark", param2 = node.param2})
			elseif node.name == "infrastructure:aircraft_warning_light_dark" then
				minetest.swap_node(pos, {name = "infrastructure:aircraft_warning_light_bright", param2 = node.param2})
			end
		end
	})

	minetest.register_node("infrastructure:aircraft_warning_light_bright", {
		description = "Aircraft warning light",
		tiles = {
			"infrastructure_aircraft_warning_light_top_bright.png",
			"infrastructure_traffic_lights_side.png",
			"infrastructure_aircraft_warning_light_side_bright.png",
			"infrastructure_aircraft_warning_light_side_bright.png",
			"infrastructure_aircraft_warning_light_side_bright.png",
			"infrastructure_aircraft_warning_light_side_bright.png"
		},
		drawtype = "nodebox",
		paramtype = "light",
		groups = {cracky = 1},
		light_source = AIRCRAFT_WARNING_LIGHT_LIGHT_RANGE,
		node_box = {
			type = "fixed",
				fixed = {
					{-1/128, 1/4, -1/128, 1/128, 3/8, 1/128},

					{-1/4, -1/8, 0, 1/4, 1/4, 0},
					{0, -1/8, -1/4, 0, 1/4, 1/4},

					{-1/16, -1/8, -1/16, 1/16, 1/16, 1/16},

					{-1/4, -1/4, -1/8, 1/4, -1/8, 1/8},
					{-1/8, -1/4, -1/4, 1/8, -1/8, 1/4},

					{-1/8, -3/8, -1/8, 1/8, -1/4, 1/8},

					{-3/16, -1/2, -3/16, 3/16, -3/8, 3/16}
				}
		},
		selection_box = {
			type = "fixed",
				fixed = {
					{-1/128, 1/4, -1/128, 1/128, 3/8, 1/128},

					{-1/4, -1/8, 0, 1/4, 1/4, 0},
					{0, -1/8, -1/4, 0, 1/4, 1/4},

					{-1/16, -1/8, -1/16, 1/16, 1/16, 1/16},

					{-1/4, -1/4, -1/8, 1/4, -1/8, 1/8},
					{-1/8, -1/4, -1/4, 1/8, -1/8, 1/4},

					{-1/8, -3/8, -1/8, 1/8, -1/4, 1/8},

					{-3/16, -1/2, -3/16, 3/16, -3/8, 3/16}
				}
		}
	})

	minetest.register_node("infrastructure:aircraft_warning_light_dark", {
		tiles = {
			"infrastructure_aircraft_warning_light_top_dark.png",
			"infrastructure_traffic_lights_side.png",
			"infrastructure_aircraft_warning_light_side_dark.png",
			"infrastructure_aircraft_warning_light_side_dark.png",
			"infrastructure_aircraft_warning_light_side_dark.png",
			"infrastructure_aircraft_warning_light_side_dark.png"
		},
		drawtype = "nodebox",
		paramtype = "light",
		groups = {cracky = 1, not_in_creative_inventory = 1},
		drop = "infrastructure:aircraft_warning_light_bright",
		node_box = {
			type = "fixed",
				fixed = {
					{-1/128, 1/4, -1/128, 1/128, 3/8, 1/128},

					{-1/4, -1/8, 0, 1/4, 1/4, 0},
					{0, -1/8, -1/4, 0, 1/4, 1/4},

					{-1/16, -1/8, -1/16, 1/16, 1/16, 1/16},

					{-1/4, -1/4, -1/8, 1/4, -1/8, 1/8},
					{-1/8, -1/4, -1/4, 1/8, -1/8, 1/4},

					{-1/8, -3/8, -1/8, 1/8, -1/4, 1/8},

					{-3/16, -1/2, -3/16, 3/16, -3/8, 3/16}
				}
		},
		selection_box = {
			type = "fixed",
				fixed = {
					{-1/128, 1/4, -1/128, 1/128, 3/8, 1/128},

					{-1/4, -1/8, 0, 1/4, 1/4, 0},
					{0, -1/8, -1/4, 0, 1/4, 1/4},

					{-1/16, -1/8, -1/16, 1/16, 1/16, 1/16},

					{-1/4, -1/4, -1/8, 1/4, -1/8, 1/8},
					{-1/8, -1/4, -1/4, 1/8, -1/8, 1/4},

					{-1/8, -3/8, -1/8, 1/8, -1/4, 1/8},

					{-3/16, -1/2, -3/16, 3/16, -3/8, 3/16}
				}
		}
	})

	minetest.register_alias("infrastructure:aircraft_warning_light", "infrastructure:aircraft_warning_light_bright")