init.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. {'aqua1', 'Aqua', '10'},
  12. {'grey1', 'Grey', '11'},
  13. {'ofa', 'Obsidian Framed Aqua', '12'},
  14. {'ofg', 'Obsidian Framed Grey', '13'},
  15. }
  16. for i in ipairs (glass_table) do
  17. local name = glass_table[i][1]
  18. local desc = glass_table[i][2]
  19. local texture = glass_table[i][3]
  20. minetest.register_node('stainedglass:'..name..'s', {
  21. description = desc..' Glass',
  22. drawtype = 'nodebox',
  23. node_box = {
  24. type = 'fixed',
  25. fixed = {-0.5, -0.5, -0.04, 0.5, 0.5, 0.04}
  26. },
  27. tiles = {'blank.png', 'blank.png', 'blank.png', 'blank.png', 'stainedglass-'..texture..'.png', 'stainedglass-'..texture..'.png'},
  28. inventory_image = 'stainedglass-'..texture..'.png',
  29. use_texture_alpha = 'blend',
  30. sunlight_propagates = true,
  31. paramtype = 'light',
  32. paramtype2 = 'facedir',
  33. groups = {oddly_breakable_by_hand=3},
  34. })
  35. minetest.register_node('stainedglass:'..name..'d', {
  36. description = desc..' Glass (Double Height)',
  37. drawtype = 'nodebox',
  38. node_box = {
  39. type = 'fixed',
  40. fixed = {-0.5, -0.5, -0.04, 0.5, 1.5, 0.04}
  41. },
  42. tiles = {'blank.png', 'blank.png', 'blank.png', 'blank.png', 'stainedglass-'..texture..'.png', 'stainedglass-'..texture..'.png'},
  43. inventory_image = 'stainedglass-'..texture..'.png^stainedglass-x2.png',
  44. use_texture_alpha = 'blend',
  45. sunlight_propagates = true,
  46. paramtype = 'light',
  47. paramtype2 = 'facedir',
  48. groups = {oddly_breakable_by_hand=3},
  49. })
  50. minetest.register_craft({
  51. output = 'stainedglass:'..name..'d',
  52. recipe = {
  53. {'stainedglass:'..name..'s'},
  54. {'stainedglass:'..name..'s'}
  55. }
  56. })
  57. end