1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
local S = homedecor.gettext
local pframe_cbox = {
type = "fixed",
fixed = { -0.18, -0.5, -0.08, 0.18, -0.08, 0.18 }
}
local n = { 1, 2 }
for _, i in ipairs(n) do
homedecor.register("picture_frame"..i, {
description = S("Picture Frame "..i),
mesh = "homedecor_picture_frame.obj",
tiles = {
"homedecor_picture_frame_image"..i..".png",
homedecor.lux_wood,
"homedecor_picture_frame_back.png",
},
inventory_image = "homedecor_picture_frame"..i.."_inv.png",
wield_image = "homedecor_picture_frame"..i.."_inv.png",
groups = {snappy = 3},
selection_box = pframe_cbox,
walkable = false,
sounds = default.node_sound_glass_defaults()
})
end
local p_cbox = {
type = "fixed",
fixed = {
{ -0.5, -0.5, 0.4375, 0.5, 0.5, 0.5 }
}
}
for i = 1,20 do
homedecor.register("painting_"..i, {
description = S("Decorative painting #@1", i),
mesh = "homedecor_painting.obj",
tiles = {
"default_wood.png",
"homedecor_blank_canvas.png",
"homedecor_painting"..i..".png"
},
selection_box = p_cbox,
walkable = false,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
})
end
-- crafting
minetest.register_craftitem(":homedecor:blank_canvas", {
description = S("Blank Canvas"),
inventory_image = "homedecor_blank_canvas.png"
})
-- paintings
minetest.register_craft({
output = "homedecor:blank_canvas",
recipe = {
{ "", "group:stick", "" },
{ "group:stick", "wool:white", "group:stick" },
{ "", "group:stick", "" },
}
})
local painting_patterns = {
[1] = { { "brown", "red", "brown" },
{ "dark_green", "red", "green" } },
[2] = { { "green", "yellow", "green" },
{ "green", "yellow", "green" } },
[3] = { { "green", "pink", "green" },
{ "brown", "pink", "brown" } },
[4] = { { "black", "orange", "grey" },
{ "dark_green", "orange", "orange" } },
[5] = { { "blue", "orange", "yellow" },
{ "green", "red", "brown" } },
[6] = { { "green", "red", "orange" },
{ "orange", "yellow", "green" } },
[7] = { { "blue", "dark_green", "dark_green" },
{ "green", "grey", "green" } },
[8] = { { "blue", "blue", "blue" },
{ "green", "green", "green" } },
[9] = { { "blue", "blue", "dark_green" },
{ "green", "grey", "dark_green" } },
[10] = { { "green", "white", "green" },
{ "dark_green", "white", "dark_green" } },
[11] = { { "blue", "white", "blue" },
{ "blue", "grey", "dark_green" } },
[12] = { { "green", "green", "green" },
{ "grey", "grey", "green" } },
[13] = { { "blue", "blue", "grey" },
{ "dark_green", "white", "white" } },
[14] = { { "red", "yellow", "blue" },
{ "blue", "green", "violet" } },
[15] = { { "blue", "yellow", "blue" },
{ "black", "black", "black" } },
[16] = { { "red", "orange", "blue" },
{ "black", "dark_grey", "grey" } },
[17] = { { "orange", "yellow", "orange" },
{ "black", "black", "black" } },
[18] = { { "grey", "dark_green", "grey" },
{ "white", "white", "white" } },
[19] = { { "white", "brown", "green" },
{ "green", "brown", "brown" } },
[20] = { { "blue", "blue", "blue" },
{ "red", "brown", "grey" } }
}
for i,recipe in pairs(painting_patterns) do
local item1 = "dye:"..recipe[1][1]
local item2 = "dye:"..recipe[1][2]
local item3 = "dye:"..recipe[1][3]
local item4 = "dye:"..recipe[2][1]
local item5 = "dye:"..recipe[2][2]
local item6 = "dye:"..recipe[2][3]
minetest.register_craft({
output = "homedecor:painting_"..i,
recipe = {
{ item1, item2, item3 },
{ item4, item5, item6 },
{"", "homedecor:blank_canvas", "" }
}
})
end
local picture_dyes = {
{"dye:brown", "dye:green"}, -- the figure sitting by the tree, wielding a pick
{"dye:green", "dye:blue"} -- the "family photo"
}
for i in ipairs(picture_dyes) do
minetest.register_craft({
output = "homedecor:picture_frame"..i,
recipe = {
{ picture_dyes[i][1], picture_dyes[i][2] },
{ "homedecor:blank_canvas", "group:stick" },
},
})
end
|