toppers.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. _doc_items_create_entry = false,
  35. description = desc2..' topper',
  36. drawtype = 'mesh',
  37. mesh = 'mylandscaping_column_t_'..obj..'.obj',
  38. tiles = {{name='mylandscaping_'..tex..'.png'..alpha}},
  39. use_texture_alpha = 'opaque',
  40. groups = {cracky=2, not_in_creative_inventory=ml_visible, ml=1},
  41. paramtype = 'light',
  42. paramtype2 = 'facedir',
  43. sounds = default.node_sound_stone_defaults(),
  44. })
  45. end
  46. end