1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-11-15 22:40:19 +01:00
minetest_game/mods/wool/init.lua

57 lines
1.9 KiB
Lua
Raw Normal View History

2012-07-24 17:12:59 +02:00
-- minetest/wool/init.lua
-- Backwards compatibility with jordach's 16-color wool mod
minetest.register_alias("wool:dark_blue", "wool:blue")
minetest.register_alias("wool:gold", "wool:yellow")
local wool = {}
-- This uses a trick: you can first define the recipes using all of the base
-- colors, and then some recipes using more specific colors for a few non-base
-- colors available. When crafting, the last recipes will be checked first.
2012-07-24 17:12:59 +02:00
wool.dyes = {
{"white", "White", nil},
{"grey", "Grey", "basecolor_grey"},
{"black", "Black", "basecolor_black"},
{"red", "Red", "basecolor_red"},
{"yellow", "Yellow", "basecolor_yellow"},
{"green", "Green", "basecolor_green"},
{"cyan", "Cyan", "basecolor_cyan"},
{"blue", "Blue", "basecolor_blue"},
{"magenta", "Magenta", "basecolor_magenta"},
{"orange", "Orange", "excolor_orange"},
{"violet", "Violet", "excolor_violet"},
{"brown", "Brown", "unicolor_dark_orange"},
{"pink", "Pink", "unicolor_light_red"},
{"dark_grey", "Dark Grey", "unicolor_darkgrey"},
{"dark_green", "Dark Green", "unicolor_dark_green"},
2012-07-24 17:12:59 +02:00
}
for _, row in ipairs(wool.dyes) do
local name = row[1]
local desc = row[2]
local craft_color_group = row[3]
2012-07-24 17:12:59 +02:00
-- Node Definition
minetest.register_node("wool:"..name, {
description = desc.." Wool",
tile_images = {"wool_"..name..".png"},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3},
})
if craft_color_group then
2012-07-24 17:12:59 +02:00
-- Crafting from dye and white wool
minetest.register_craft({
output = 'wool:'..name..' 16',
recipe = {
{'group:'..craft_color_group},
{'wool:white'},
}
2012-07-24 17:12:59 +02:00
})
-- Shapeless group recipes don't currently work
--[[minetest.register_craft({
type = "shapeless",
output = 'wool:'..name..' 16',
recipe = {'group:'..craft_color_group, 'wool:white'},
})--]]
2012-07-24 17:12:59 +02:00
end
end