2020-05-24 15:46:26 +02:00
|
|
|
-- Test Nodes: Light test
|
|
|
|
|
|
|
|
local S = minetest.get_translator("testnodes")
|
|
|
|
|
|
|
|
-- All possible light levels
|
|
|
|
for i=1, minetest.LIGHT_MAX do
|
2022-10-09 14:05:22 +02:00
|
|
|
minetest.register_node("testnodes:light"..string.format("%02d", i), {
|
2020-05-24 15:46:26 +02:00
|
|
|
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", {
|
2020-09-04 20:50:03 +02:00
|
|
|
description = S("Sunlight Filter") .."\n"..
|
|
|
|
S("Lets light through, but weakens sunlight"),
|
2020-05-24 15:46:26 +02:00
|
|
|
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", {
|
2020-09-04 20:50:03 +02:00
|
|
|
description = S("Sunlight Propagator") .."\n"..
|
|
|
|
S("Lets all light through"),
|
2020-05-24 15:46:26 +02:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
|
|
|
|
|
|
|
|
|
|
|
drawtype = "glasslike",
|
|
|
|
tiles = {
|
|
|
|
"testnodes_sunlight_filter.png^[brighten",
|
|
|
|
},
|
|
|
|
groups = { dig_immediate = 3 },
|
|
|
|
})
|