mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-26 09:23:47 +01:00
get rid of some redundant variables
(just directly reference the table elements instead)
This commit is contained in:
parent
315dfb8283
commit
2804327825
32
init.lua
32
init.lua
@ -851,44 +851,34 @@ local shade_crafts = {
|
|||||||
|
|
||||||
for _,i in ipairs(base_color_crafts) do
|
for _,i in ipairs(base_color_crafts) do
|
||||||
local color = i[1]
|
local color = i[1]
|
||||||
local dye1 = i[2]
|
|
||||||
local dye2 = i[3]
|
|
||||||
local dye3 = i[4]
|
|
||||||
local dye4 = i[5]
|
|
||||||
local dye5 = i[6]
|
|
||||||
local yield = i[7]
|
local yield = i[7]
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "dye:"..color.." "..yield,
|
output = "dye:"..color.." "..yield,
|
||||||
recipe = {
|
recipe = {
|
||||||
dye1,
|
i[2],
|
||||||
dye2,
|
i[3],
|
||||||
dye3,
|
i[4],
|
||||||
dye4,
|
i[5],
|
||||||
dye5,
|
i[6],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
for _,j in ipairs(shade_crafts) do
|
for _,j in ipairs(shade_crafts) do
|
||||||
local shade = j[1]
|
local firstdye = j[3]
|
||||||
local sat = j[2]
|
if firstdye == "color" then firstdye = "dye:"..color end
|
||||||
local dye4 = j[3]
|
|
||||||
local dye5 = j[4]
|
|
||||||
local dye6 = j[5]
|
|
||||||
|
|
||||||
if dye4 == "color" then dye4 = "dye:"..color end
|
|
||||||
|
|
||||||
if color ~= "black" and color ~= "white" and not string.find(color, "grey") then
|
if color ~= "black" and color ~= "white" and not string.find(color, "grey") then
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "dye:"..shade..color..sat.." "..yield,
|
output = "dye:"..j[1]..color..j[2].." "..yield,
|
||||||
recipe = {
|
recipe = {
|
||||||
"dye:"..color,
|
"dye:"..color,
|
||||||
dye4,
|
firstdye,
|
||||||
dye5,
|
j[4],
|
||||||
dye6
|
j[5]
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user