Compare commits

...

2 Commits

5 changed files with 64 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

View File

@ -414,6 +414,19 @@ moresnow.register_shape = function( shape, new_name )
-0.5+(i/d), (v/d*0.5)-1.0+(1.25/d*0.5)+(1/d), 0.5-(i/d)+(1/d) }
end
end
-- add a thin layer at the front of the node - like with stairs - for the flatter ones
if( shape == 5 or shape == 6 or shape == 1) then
table.insert(slopeboxedge, {-0.5, -1.5, -0.5-1/32, 0.5, -1.25, -0.5})
if(shape == 6) then
table.insert(slopeboxedge, { 0.5, -1.5, -0.5, 0.5+1/32, -1.25, 0.5})
end
-- add a thin layer at the front of the node - like with stairs - for the half raised ones
elseif(shape == 4 or shape == 7) then
table.insert(slopeboxedge, {-0.5, -1.5, -0.5-1/16, 0.5, -0.8, -0.5})
if(shape == 7) then
table.insert(slopeboxedge, { 0.5, -1.5, -0.5, 0.5+1/16, -0.8, 0.5})
end
end
moresnow.register_snow_top( new_name, slopeboxedge, nil ); -- no wool version for these
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 B

After

Width:  |  Height:  |  Size: 261 B