init.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. -- No tricks! It confuses the craft guide (and me, too).
  2. -- This list must match the one in the "dye" mod.
  3. local dyes = {
  4. {"white", "White" },
  5. {"grey", "Grey" },
  6. {"black", "Black" },
  7. {"red", "Red" },
  8. {"yellow", "Yellow" },
  9. {"green", "Green" },
  10. {"cyan", "Cyan" },
  11. {"blue", "Blue" },
  12. {"magenta", "Magenta" },
  13. {"orange", "Orange" },
  14. {"violet", "Violet" },
  15. {"brown", "Brown" },
  16. {"pink", "Pink" },
  17. {"dark_grey", "Dark Grey" },
  18. {"dark_green", "Dark Green"},
  19. }
  20. for i = 1, #dyes, 1 do
  21. local name, desc = unpack(dyes[i])
  22. minetest.register_node("wool:" .. name, {
  23. description = desc .. " Wool",
  24. tiles = {"wool_" .. name .. ".png"},
  25. is_ground_content = false,
  26. groups = utility.dig_groups("wool", {
  27. flammable = 3, wool = 1,
  28. wool_block = 1,
  29. fall_damage_add_percent = -30,
  30. }),
  31. sounds = default.node_sound_defaults(),
  32. })
  33. minetest.register_craft{
  34. type = "shapeless",
  35. output = "wool:" .. name,
  36. recipe = {"dye:" .. name, "group:wool_block"},
  37. }
  38. end
  39. -- Backwards compatibility with jordach's 16-color wool mod
  40. minetest.register_alias("wool:dark_blue", "wool:blue")
  41. minetest.register_alias("wool:gold", "wool:yellow")