light.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. -- Test Nodes: Light test
  2. local S = minetest.get_translator("testnodes")
  3. -- All possible light levels
  4. for i=1, minetest.LIGHT_MAX do
  5. minetest.register_node("testnodes:light"..i, {
  6. description = S("Light Source (@1)", i),
  7. paramtype = "light",
  8. light_source = i,
  9. tiles ={"testnodes_light_"..i..".png"},
  10. drawtype = "glasslike",
  11. walkable = false,
  12. sunlight_propagates = true,
  13. is_ground_content = false,
  14. groups = {dig_immediate=3},
  15. })
  16. end
  17. -- Lets light through, but not sunlight, leading to a
  18. -- reduction in light level when light passes through
  19. minetest.register_node("testnodes:sunlight_filter", {
  20. description = S("Sunlight Filter") .."\n"..
  21. S("Lets light through, but weakens sunlight"),
  22. paramtype = "light",
  23. drawtype = "glasslike",
  24. tiles = {
  25. "testnodes_sunlight_filter.png",
  26. },
  27. groups = { dig_immediate = 3 },
  28. })
  29. -- Lets light and sunlight through without obstruction
  30. minetest.register_node("testnodes:sunlight_propagator", {
  31. description = S("Sunlight Propagator") .."\n"..
  32. S("Lets all light through"),
  33. paramtype = "light",
  34. sunlight_propagates = true,
  35. drawtype = "glasslike",
  36. tiles = {
  37. "testnodes_sunlight_filter.png^[brighten",
  38. },
  39. groups = { dig_immediate = 3 },
  40. })