init.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. local glass_table = { --name, description, texture Set img transparency to 15 before Export.
  2. {'white', 'White', '01'},
  3. {'grey75', 'Light Grey', '02'},
  4. {'grey50', 'Grey', '03'},
  5. {'grey25', 'Dark Grey', '04'},
  6. {'black', 'Black', '05'}
  7. }
  8. for i in ipairs (glass_table) do
  9. local name = glass_table[i][1]
  10. local desc = glass_table[i][2]
  11. local texture = glass_table[i][3]
  12. minetest.register_node('glass:'..name..'s', {
  13. description = desc..' Glass',
  14. drawtype = 'nodebox',
  15. node_box = {
  16. type = 'fixed',
  17. fixed = {-0.5, -0.5, -0.1, 0.5, 0.5, 0.1}
  18. },
  19. tiles = {'blank.png', 'blank.png', 'blank.png', 'blank.png', 'glass-'..texture..'.png', 'glass-'..texture..'.png'},
  20. inventory_image = 'glass-'..texture..'.png',
  21. use_texture_alpha = 'blend',
  22. sunlight_propagates = true,
  23. paramtype = 'light',
  24. paramtype2 = 'facedir',
  25. groups = {breakable=1},
  26. })
  27. minetest.register_node('glass:'..name..'d', {
  28. description = desc..' Glass (Double Height)',
  29. drawtype = 'nodebox',
  30. node_box = {
  31. type = 'fixed',
  32. fixed = {-0.5, -0.5, -0.1, 0.5, 1.5, 0.1}
  33. },
  34. tiles = {'blank.png', 'blank.png', 'blank.png', 'blank.png', 'glass-'..texture..'.png', 'glass-'..texture..'.png'},
  35. inventory_image = 'glass-'..texture..'.png^glass-x2.png',
  36. use_texture_alpha = 'blend',
  37. sunlight_propagates = true,
  38. paramtype = 'light',
  39. paramtype2 = 'facedir',
  40. groups = {breakable=1},
  41. })
  42. end