light.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. -- Test Nodes: Light test
  2. local S = core.get_translator("testnodes")
  3. -- All possible light levels
  4. for i=1, core.LIGHT_MAX do
  5. core.register_node("testnodes:light"..string.format("%02d", 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. core.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. core.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. })