added multicolor wool cover

This commit is contained in:
Sokomine 2024-01-13 22:10:16 +01:00
parent 8a8441b113
commit 2440aef317
4 changed files with 36 additions and 4 deletions

View File

@ -10,7 +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"};
"magenta", "orange", "violet", "brown", "pink", "dark_grey", "dark_green",
"multicolor"};
-- 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;

View File

@ -59,7 +59,7 @@ moresnow.register_snow_top = function( node_name, fixed_nodebox, wool_nodebox, l
fixed = leaves_nodebox or wool_nodebox or fixed_nodebox,
},
drop = "moresnow:autumnleaves",
groups = {falling_node=1, float=1, not_in_creative_inventory=1, snappy=3, flammable=2, leaves=1, not_in_creative_inventory=1},
groups = {falling_node=1, float=1, not_in_creative_inventory=1, snappy=3, flammable=2, leaves=1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function( pos )
return moresnow.on_construct_leaves( pos, 'moresnow:autumnleaves_'..node_name );
@ -69,6 +69,13 @@ moresnow.register_snow_top = function( node_name, fixed_nodebox, wool_nodebox, l
if( wool_nodebox and moresnow.wool_dyes and minetest.get_modpath( 'wool' )) then
for _,v in ipairs( moresnow.wool_dyes ) do
local ptype2 = "facedir"
local palette = nil
if(v == "multicolor") then
ptype2 = "color4dir"
-- palette = "unifieddyes_palette_extended.png"
palette = "moresnow_palette.png"
end
minetest.register_node( "moresnow:wool_"..v.."_"..node_name, {
description = "layers of wool ("..v..")",
tiles = {"wool_"..v..".png"},
@ -76,14 +83,15 @@ moresnow.register_snow_top = function( node_name, fixed_nodebox, wool_nodebox, l
-- wield_image = "moresnow_autumnleaves.png",
is_ground_content = true,
paramtype = "light",
paramtype2 = "facedir",
paramtype2 = ptype2,
palette = palette,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = wool_nodebox,
},
drop = "moresnow:wool_"..v,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1, float=1, not_in_creative_inventory=1},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1, float=1, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
on_construct = function( pos )
@ -156,12 +164,33 @@ end
if( moresnow.wool_dyes and minetest.get_modpath( 'wool' )) then
for _,v in ipairs( moresnow.wool_dyes ) do
local ptype2 = "facedir"
local palette = nil
local on_punch = nil
local on_rightclick = nil
if(v == "multicolor") then
ptype2 = "color4dir"
-- palette = "unifieddyes_palette_extended.png"
palette = "moresnow_palette.png"
on_punch = function(pos, node, puncher, pointed_thing)
local node = minetest.get_node(pos)
node.param2 = (node.param2 + 4) % 256
minetest.swap_node(pos, node)
end
on_rightclick = function(pos, node, puncher, pointed_thing)
local node = minetest.get_node(pos)
node.param2 = (node.param2 - 4) % 256
minetest.swap_node(pos, node)
end
end
table.insert( moresnow.nodetypes, 'wool_'..v );
minetest.register_node( "moresnow:wool_"..v, {
description = "layers of wool ("..v..")",
tiles = {"wool_"..v..".png"},
is_ground_content = true,
paramtype = "light",
paramtype2 = ptype2,
palette = palette,
leveled = 7, -- can pile up as well
drawtype = "nodebox",
node_box = {
@ -177,6 +206,8 @@ if( moresnow.wool_dyes and minetest.get_modpath( 'wool' )) then
on_construct = function( pos )
return moresnow.on_construct_wool( pos, 'moresnow:wool_'..v, v );
end,
on_punch = on_punch,
on_rightclick = on_rightclick,
});
-- craft one wool block into 9 layers

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B