2
0

init.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. -- wool/init.lua
  2. -- Load support for MT game translation.
  3. local S = minetest.get_translator("wool")
  4. local dyes = dye.dyes
  5. for i = 1, #dyes do
  6. local name, desc = unpack(dyes[i])
  7. local color_group = "color_" .. name
  8. minetest.register_node("wool:" .. name, {
  9. description = S(desc .. " Wool"),
  10. tiles = {"wool_" .. name .. ".png"},
  11. is_ground_content = false,
  12. groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3,
  13. flammable = 3, wool = 1, [color_group] = 1},
  14. sounds = default.node_sound_defaults(),
  15. })
  16. minetest.register_craft{
  17. type = "shapeless",
  18. output = "wool:" .. name,
  19. recipe = {"group:dye," .. color_group, "group:wool"},
  20. }
  21. end
  22. -- Legacy
  23. -- Backwards compatibility with jordach's 16-color wool mod
  24. minetest.register_alias("wool:dark_blue", "wool:blue")
  25. minetest.register_alias("wool:gold", "wool:yellow")
  26. -- Dummy calls to S() to allow translation scripts to detect the strings.
  27. -- To update this run:
  28. -- for _,e in ipairs(dye.dyes) do print(("S(%q)"):format(e[2].." Wool")) end
  29. --[[
  30. S("White Wool")
  31. S("Grey Wool")
  32. S("Dark Grey Wool")
  33. S("Black Wool")
  34. S("Violet Wool")
  35. S("Blue Wool")
  36. S("Cyan Wool")
  37. S("Dark Green Wool")
  38. S("Green Wool")
  39. S("Yellow Wool")
  40. S("Brown Wool")
  41. S("Orange Wool")
  42. S("Red Wool")
  43. S("Magenta Wool")
  44. S("Pink Wool")
  45. --]]