init.lua 1.2 KB

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