toppers.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. local block_type1 = { -- desc2, obj, texture
  2. {'Sphere', 'sphere', 'concrete'},
  3. {'Suzanne', 'suzanne', 'concrete'},
  4. {'Dragon', 'dragon', 'dragon'},
  5. {'Cross', 'cross', 'concrete'},
  6. }
  7. for i in ipairs (block_type1) do
  8. local desc2 = block_type1[i][1]
  9. local obj = block_type1[i][2]
  10. local tex = block_type1[i][3]
  11. local color_tab = {
  12. {'black', 'Black', '^[multiply:#2c2c2c'},
  13. {'blue', 'Blue', '^[multiply:#0041f4'},
  14. {'brown', 'Brown', '^[multiply:#6c3800'},
  15. {'cyan', 'Cyan', '^[multiply:cyan'},
  16. {'dark_green', 'Dark Green', '^[multiply:#2b7b00'},
  17. {'dark_grey', 'Dark Grey', '^[multiply:#464646'},
  18. {'green', 'Green', '^[multiply:#67eb1c'},
  19. {'grey', 'Grey', '^[multiply:#818181'},
  20. {'magenta', 'Magenta', '^[multiply:#d80481'},
  21. {'orange', 'Orange', '^[multiply:#e0601a'},
  22. {'pink', 'Pink', '^[multiply:#ffa5a5'},
  23. {'red', 'Red', '^[multiply:#c91818'},
  24. {'violet', 'Violet', '^[multiply:#480680'},
  25. {'white', 'White', '^[multiply:white'},
  26. {'yellow', 'Yellow', '^[multiply:#fcf611'},
  27. {'cement', 'Concrete', ''},
  28. }
  29. for i in ipairs (color_tab) do
  30. local col = color_tab[i][1]
  31. local coldesc = color_tab[i][2]
  32. local alpha = color_tab[i][3]
  33. minetest.register_node('mylandscaping:column_t_'..obj..'_'..col, {
  34. description = desc2..' topper',
  35. drawtype = 'mesh',
  36. mesh = 'mylandscaping_column_t_'..obj..'.obj',
  37. tiles = {{name='mylandscaping_'..tex..'.png'..alpha}},
  38. groups = {cracky=2, not_in_creative_inventory=ml_visible, ml=1},
  39. paramtype = 'light',
  40. paramtype2 = 'facedir',
  41. sounds = default.node_sound_stone_defaults(),
  42. })
  43. end
  44. end