-
Notifications
You must be signed in to change notification settings - Fork 12
/
init.lua~
299 lines (211 loc) · 6.9 KB
/
init.lua~
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
--[[
Stained Glass 1.1
This mod provides luminescent stained glass blocks for Minetest 0.4.x.
Depends:
[moreblocks] by Calinou
[unifieddyes] by VanessaE
==============================================================================
Sun 24 Feb 2013 11:52:27 AM EST
Copyright (C) 2013, Eli Innis
Email: doyousketch2 @ yahoo.com
Unified Dyes was released under GNU-GPL 2.0, see LICENSE for info.
More Blocks was released under zlib/libpng for code and CC BY-SA 3.0 Unported for textures, see LICENSE.txt for info.
==============================================================================
Recipe for standard colors:
dye
super glow glass
super glow glass
super glow glass
Recipe for pastel colors:
light dye
white paint
super glow glass
super glow glass
super glow glass
Recipe for faint colors:
light dye
white paint
white paint
super glow glass
super glow glass
super glow glass
All recipes produce three glowing stained glass blocks.
Pastel blocks give back an empty bucket.
Faint blocks give back two empty buckets.
==============================================================================
]]--
-- HUES includes all colors for the various shades
-- I'm trying to get it to sort by color in the game, tho it sorts alpha-numerically...
-- so with 12 colors, it's sorting 10, 11, 12, 1, 2, 3, 4...
HUES = {
"yellow",
"lime",
"green",
"aqua",
"cyan",
"skyblue",
"blue",
"violet",
"magenta",
"redviolet",
"red",
"orange"
}
-- Brightness levels in the textures are 33% ("dark"), 66% ("medium"),
-- 100% ("full"), 150% ("light"), 200% ("pastel").
-- 1x and 2x are simply placeholders to fill in so numbers start at 3.
BRIGHT = {
"1x",
"2x",
"dark_",
"medium_",
"", --(full)
}
-- Saturation - "s50" in a file/item name means "saturation: 50%".
-- 1x - 5x are simply placeholders so numbers start at 6.
SAT = {
"1x",
"2x",
"3x",
"4x",
"5x",
"_s50",
"" --(full)
}
--main loop for all 12 hues
for h = 1, 12 do
hues = HUES[h]
--nested loop for brightness
--starts at 3 to hopefully keep colors in order
for b = 3, 5 do
bright = BRIGHT[b]
--sub loop for saturation
--starts at 6 to keep colors in order
for s = 6, 7 do
sat = SAT[s]
--register recipes
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_" .. (b) .. "_" .. (s) .." 3",
recipe = {
"unifieddyes:" .. bright .. hues .. sat,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_" .. (b) .. "_" .. (s), {
description = "Stained Glass - " .. bright .. hues .. sat,
drawtype = "glasslike",
tiles = {"stained_glass_" .. bright .. hues .. sat .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_" .. bright .. hues .. sat .. ".png"),
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --sat
end --bright
end --hues
--secondary loop for light blocks
--(as they don't have 50% saturation blocks to go along with 'em)
for h = 1, 12 do
hues = HUES[h]
--register recipes (set at 8 to keep colors in order)
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_8 3",
recipe = {
"unifieddyes:light_" .. hues,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_8_", {
description = "Stained Glass - light_" .. hues,
drawtype = "glasslike",
tiles = {"stained_glass_light_" .. hues .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_light_" .. hues .. ".png"),
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --hues
--third loop for pastel blocks
--(as they don't have 50% saturation blocks to go along with 'em)
--(plus they have a diff recipe to create.)
for h = 1, 12 do
hues = HUES[h]
--register recipes (set at 9 to keep colors in order)
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_9 3",
recipe = {
"unifieddyes:white_paint",
"unifieddyes:light_" .. hues,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
replacements = { {'unifieddyes:white_paint', 'bucket:bucket_empty'}, },
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_9", {
description = "Stained Glass - pastel_" .. hues,
drawtype = "glasslike",
tiles = {"stained_glass_pastel_" .. hues .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_pastel_" .. hues .. ".png"),
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --hues
--last loop for faint blocks
--(as they don't have 50% saturation blocks to go along with 'em)
--(plus they have a diff recipe to create.)
for h = 1, 12 do
hues = HUES[h]
--register recipes (set at 91 to keep colors in order)
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_91 3",
recipe = {
"unifieddyes:white_paint",
"unifieddyes:white_paint",
"unifieddyes:light_" .. hues,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
replacements = { {'unifieddyes:white_paint', 'bucket:bucket_empty 2'}, },
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_91", {
description = "Stained Glass - faint_" .. hues,
drawtype = "glasslike",
tiles = {"stained_glass_faint_" .. hues .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_faint_" .. hues .. ".png"),
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --hues
print("[stained_glass] Loaded!")