first attempt at crafting receipes for multicolored wool layers

This commit is contained in:
Sokomine 2024-01-18 20:34:40 +01:00
parent b33e3a1b5d
commit 718bd9b172
4 changed files with 51 additions and 3 deletions

41
crafts.lua Normal file
View File

@ -0,0 +1,41 @@
if(moresnow.enable_wool_cover) then
local dyes = {"white", "grey", "dark_grey", "black",
"violet", "blue", "cyan", "dark_green", "green",
"yellow", "brown", "orange", "red", "magenta", "pink",
-- wool has 15 colors - we have to cover 64 hues
"bonus"}
for i, dye in ipairs(dyes) do
local dye_item = "dye:"..dye
if(dye == "bonus") then
dye_item = "wool:white"
end
-- 64 colors - a standard palette has 256. thus, *4
local c = (i-1)*4
minetest.register_craft({
output = minetest.itemstring_with_palette("moresnow:wool_multicolor", c),
recipe = {{"moresnow:wool_multicolor", dye_item, ""}},
replacements = {{"", dye_item, ""}},
})
-- get the other four color variants each:
-- based on darkest color from the respective wool variant:
minetest.register_craft({
output = minetest.itemstring_with_palette("moresnow:wool_multicolor", (c+16)),
recipe = {{"moresnow:wool_multicolor", dye_item, "dye:black",}},
replacements = {{"", dye_item, "dye:black"}},
})
-- based on color by standard name (i.e. "red"):
minetest.register_craft({
output = minetest.itemstring_with_palette("moresnow:wool_multicolor", (c+32)),
recipe = {{"moresnow:wool_multicolor", dye_item, "dye:grey",}},
replacements = {{"", dye_item, "dye:grey"}},
})
-- pastel colors:
minetest.register_craft({
output = minetest.itemstring_with_palette("moresnow:wool_multicolor", (c+48)),
recipe = {{"moresnow:wool_multicolor", dye_item, "dye:white",}},
replacements = {{"", dye_item, "dye:white"}},
})
end
end

View File

@ -10,8 +10,8 @@ moresnow.enable_autumnleaves = true
-- wool is useful for covering stairs; turns them into benches;
-- change this if you want the wool functionality only for a few nodes (i.e. only white - or none at all)
moresnow.wool_dyes = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue",
"magenta", "orange", "violet", "brown", "pink", "dark_grey", "dark_green",
"multicolor"};
"magenta", "orange", "violet", "brown", "pink", "dark_grey", "dark_green"}
moresnow.enable_wool_cover = true
-- the snow cannon allows to create snow
moresnow.enable_snow_cannon = true
-- with this set, the snow cannon can *shoot* snowballs - which will fly a long way;
@ -20,6 +20,11 @@ moresnow.crazy_mode = true
-- end of configuration
--------------------------------------------------------------------------------
-- one colored wool layer that comes in 64 colors (uses color4dir):
if(moresnow.enable_wool_cover) then
table.insert(moresnow.wool_dyes, "multicolor")
end
-- which shapes can we cover?
moresnow.shapes = {'top', 'fence', 'stair', 'slab',
'panel', 'micro', 'outer_stair', 'inner_stair',
@ -70,3 +75,5 @@ if( moresnow.enable_snow_cannon ) then
dofile(modpath..'snow_cannon.lua');
end
-- crafting
dofile(modpath..'crafts.lua')

View File

@ -4,4 +4,4 @@ release = 202411011800
title = More Snow
name = moresnow
depends = default
optional_depends = stairs, moreblocks, homedecor_roofing, technic
optional_depends = stairs, moreblocks, homedecor_roofing, technic, dye

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 B

After

Width:  |  Height:  |  Size: 261 B