summaryrefslogtreecommitdiff
path: root/games/devtest/mods/testnodes/light.lua
blob: 8ab4416d9098db197d2eca5e32693b621c5379a5 (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
-- Test Nodes: Light test

local S = minetest.get_translator("testnodes")

-- All possible light levels
for i=1, minetest.LIGHT_MAX do
	minetest.register_node("testnodes:light"..i, {
		description = S("Light Source (@1)", i),
		paramtype = "light",
		light_source = i,


		tiles ={"testnodes_light_"..i..".png"},
		drawtype = "glasslike",
		walkable = false,
		sunlight_propagates = true,
		is_ground_content = false,
		groups = {dig_immediate=3},
	})
end

-- Lets light through, but not sunlight, leading to a
-- reduction in light level when light passes through
minetest.register_node("testnodes:sunlight_filter", {
	description = S("Sunlight Filter") .."\n"..
		S("Lets light through, but weakens sunlight"),
	paramtype = "light",


	drawtype = "glasslike",
	tiles = {
		"testnodes_sunlight_filter.png",
	},
	groups = { dig_immediate = 3 },
})

-- Lets light and sunlight through without obstruction
minetest.register_node("testnodes:sunlight_propagator", {
	description = S("Sunlight Propagator") .."\n"..
		S("Lets all light through"),
	paramtype = "light",
	sunlight_propagates = true,


	drawtype = "glasslike",
	tiles = {
		"testnodes_sunlight_filter.png^[brighten",
	},
	groups = { dig_immediate = 3 },
})