2019-09-10 19:09:51 +02:00
|
|
|
-- wool/init.lua
|
|
|
|
|
|
|
|
-- Load support for MT game translation.
|
|
|
|
local S = minetest.get_translator("wool")
|
|
|
|
|
2019-05-26 21:21:31 +02:00
|
|
|
local dyes = dye.dyes
|
2013-05-18 16:05:16 +02:00
|
|
|
|
2016-06-27 14:02:44 +02:00
|
|
|
for i = 1, #dyes do
|
2018-08-23 21:42:36 +02:00
|
|
|
local name, desc = unpack(dyes[i])
|
2016-06-27 14:02:44 +02:00
|
|
|
|
2022-09-20 21:43:56 +02:00
|
|
|
local color_group = "color_" .. name
|
|
|
|
|
2016-06-27 14:02:44 +02:00
|
|
|
minetest.register_node("wool:" .. name, {
|
2019-09-12 19:03:10 +02:00
|
|
|
description = S(desc .. " Wool"),
|
2016-06-27 14:02:44 +02:00
|
|
|
tiles = {"wool_" .. name .. ".png"},
|
2015-06-14 05:58:54 +02:00
|
|
|
is_ground_content = false,
|
2016-06-27 14:02:44 +02:00
|
|
|
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3,
|
2022-09-20 21:43:56 +02:00
|
|
|
flammable = 3, wool = 1, [color_group] = 1},
|
2013-05-18 16:05:16 +02:00
|
|
|
sounds = default.node_sound_defaults(),
|
|
|
|
})
|
2016-06-27 14:02:44 +02:00
|
|
|
|
|
|
|
minetest.register_craft{
|
|
|
|
type = "shapeless",
|
|
|
|
output = "wool:" .. name,
|
2022-09-20 21:43:56 +02:00
|
|
|
recipe = {"group:dye," .. color_group, "group:wool"},
|
2016-06-27 14:02:44 +02:00
|
|
|
}
|
2013-05-18 16:05:16 +02:00
|
|
|
end
|
|
|
|
|
2018-08-23 21:42:36 +02:00
|
|
|
-- Legacy
|
2016-06-27 14:02:44 +02:00
|
|
|
-- Backwards compatibility with jordach's 16-color wool mod
|
|
|
|
minetest.register_alias("wool:dark_blue", "wool:blue")
|
|
|
|
minetest.register_alias("wool:gold", "wool:yellow")
|
2019-09-12 19:03:10 +02:00
|
|
|
|
|
|
|
-- Dummy calls to S() to allow translation scripts to detect the strings.
|
|
|
|
-- To update this run:
|
|
|
|
-- for _,e in ipairs(dye.dyes) do print(("S(%q)"):format(e[2].." Wool")) end
|
|
|
|
|
|
|
|
--[[
|
|
|
|
S("White Wool")
|
|
|
|
S("Grey Wool")
|
|
|
|
S("Dark Grey Wool")
|
|
|
|
S("Black Wool")
|
|
|
|
S("Violet Wool")
|
|
|
|
S("Blue Wool")
|
|
|
|
S("Cyan Wool")
|
|
|
|
S("Dark Green Wool")
|
|
|
|
S("Green Wool")
|
|
|
|
S("Yellow Wool")
|
|
|
|
S("Brown Wool")
|
|
|
|
S("Orange Wool")
|
|
|
|
S("Red Wool")
|
|
|
|
S("Magenta Wool")
|
|
|
|
S("Pink Wool")
|
|
|
|
--]]
|