init.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. local glass_table = { --name, description, texture
  2. {'blue1', 'Blue Prism', '1'},
  3. {'green1', 'Green Prism', '2'},
  4. {'red1', 'Red Prism', '3'},
  5. {'blue2', 'Blue Diamonds', '4'},
  6. {'green2', 'Green Diamonds', '5'},
  7. {'red2', 'Red Diamonds', '6'},
  8. {'yg', 'Yellow in Green', '7'},
  9. {'floral', 'Floral Pattern', '8'},
  10. {'rb', 'Red in Blue', '9'},
  11. }
  12. for i in ipairs (glass_table) do
  13. local name = glass_table[i][1]
  14. local desc = glass_table[i][2]
  15. local texture = glass_table[i][3]
  16. minetest.register_node('stainedglass:'..name..'s', {
  17. description = desc..' Glass',
  18. drawtype = 'nodebox',
  19. node_box = {
  20. type = 'fixed',
  21. fixed = {-0.5, -0.5, -0.04, 0.5, 0.5, 0.04}
  22. },
  23. tiles = {'blank.png', 'blank.png', 'blank.png', 'blank.png', 'stainedglass-'..texture..'.png', 'stainedglass-'..texture..'.png'},
  24. inventory_image = 'stainedglass-'..texture..'.png',
  25. use_texture_alpha = true,
  26. sunlight_propagates = true,
  27. paramtype = 'light',
  28. paramtype2 = 'facedir',
  29. groups = {oddly_breakable_by_hand=3},
  30. })
  31. minetest.register_node('stainedglass:'..name..'d', {
  32. description = desc..' Glass (Double Height)',
  33. drawtype = 'nodebox',
  34. node_box = {
  35. type = 'fixed',
  36. fixed = {-0.5, -0.5, -0.04, 0.5, 1.5, 0.04}
  37. },
  38. tiles = {'blank.png', 'blank.png', 'blank.png', 'blank.png', 'stainedglass-'..texture..'.png', 'stainedglass-'..texture..'.png'},
  39. inventory_image = 'stainedglass-'..texture..'.png^stainedglass-x2.png',
  40. use_texture_alpha = true,
  41. sunlight_propagates = true,
  42. paramtype = 'light',
  43. paramtype2 = 'facedir',
  44. groups = {oddly_breakable_by_hand=3},
  45. })
  46. minetest.register_craft({
  47. output = 'stainedglass:'..name..'d',
  48. recipe = {
  49. {'stainedglass:'..name..'s'},
  50. {'stainedglass:'..name..'s'}
  51. }
  52. })
  53. end