Compare commits

...

5 Commits

Author SHA1 Message Date
Sokomine f61438a6bd use morecolor palette if available 2017-08-06 18:40:44 +02:00
Sokomine 7812d24144 adjusted receipe in order to avoid conflict with trapdoor 2017-08-01 18:30:07 +02:00
Sokomine a93f223c63 added support for colorfacedir 2017-08-01 18:22:15 +02:00
Sokomine 6f462eced6 added aspen fences 2017-07-31 20:47:00 +02:00
Sokomine dc0fd8efd0 removed group 'pane' which seems to have a diffrent meaning now 2017-07-31 20:40:28 +02:00
3 changed files with 31 additions and 7 deletions

View File

@ -11,4 +11,9 @@ You might also be intrested in
For more information, see
[this forum thread](https://forum.minetest.net/viewtopic.php?f=9&t=13189&p=190683)
Changes:
01.08.2017 Adjusted receipe in order to avoid conflict with trapdoor
01.08.2017 Added support for colorfacedir
30.07.2017 Fixed bug regarding group "pane"
License: GPLv3

View File

@ -32,6 +32,7 @@ xconnected.register_fence('xconnected:fence', 'default_wood.png',
xconnected.register_fence('xconnected:fence_pine', 'default_pine_wood.png', 'default:pine_wood');
xconnected.register_fence('xconnected:fence_jungle', 'default_junglewood.png', 'default:junglewood');
xconnected.register_fence('xconnected:fence_acacia', 'default_acacia_wood.png', 'default:acacia_wood');
xconnected.register_fence('xconnected:fence_aspen', 'default_aspen_wood.png', 'default:aspen_wood');
--[[
-- this innocent loop creates quite a lot of nodes - but only if you have the stained_glass mod installed

View File

@ -1,6 +1,11 @@
xconnected = {}
-- if unifieddyes or morecolor is installed, use colorfacedir
xconnected.with_unifieddyes = minetest.get_modpath( "unifieddyes");
-- morecolor adds less colors than unifieddyes (but more than none)
xconnected.with_morecolor = minetest.get_modpath( "morecolor");
-- change the drops value if you want the player to get one of the other node types when digged (i.e. c0 or ln or lp)
local drops = "c4";
@ -101,12 +106,15 @@ xconnected_update_one_node = function( pos, name, digged )
end
local new_node = xconnected_get_candidate[ id ];
if( new_node and new_node[1] ) then
local node = minetest.get_node(pos);
-- support for coloredfacedir
local p2_color = node.param2 - (node.param2 % 32);
local new_name = string.sub( name, 1, string.len( name )-3 )..new_node[1];
if( new_name and minetest.registered_nodes[ new_name ]) then
minetest.swap_node( pos, {name=new_name, param2=new_node[2] });
minetest.swap_node( pos, {name=new_name, param2=new_node[2] + p2_color });
-- if no central node without neighbours is defined, take the c4 variant
elseif( new_node[1]=='_c0' and not( minetest.registered_nodes[ new_name ])) then
minetest.swap_node( pos, {name=name, param2=0 });
minetest.swap_node( pos, {name=name, param2=p2_color });
end
end
return candidates;
@ -137,7 +145,15 @@ xconnected.register = function( name, def, node_box_data, selection_box_data, cr
-- some common values for all xconnected nodes
def.drawtype = "nodebox";
def.paramtype = "light";
def.paramtype2 = "facedir";
if( xconnected.with_morecolor ) then
def.paramtype2 = "colorfacedir";
def.palette = "colorfacedir_palette.png";
elseif( xconnected.with_unifieddyes ) then
def.paramtype2 = "colorfacedir";
def.palette = "unifieddyes_palette_colorwallmounted.png";
else
def.paramtype2 = "facedir";
end
-- similar xconnected nodes are identified by having the same drop
def.drop = name.."_"..drops; -- default: "_c4";
-- nodebox and selection box have been calculated using smmyetry
@ -160,6 +176,8 @@ xconnected.register = function( name, def, node_box_data, selection_box_data, cr
else
def.groups.xconnected = 1;
end
-- that group apparently got a new meaning
def.groups.pane = nil;
local new_def = minetest.deserialize( minetest.serialize( def ));
if( k==drops ) then
@ -190,7 +208,7 @@ xconnected.register = function( name, def, node_box_data, selection_box_data, cr
output = name.."_"..drops.." 6",
recipe = {
{craft_from, craft_from, craft_from},
{craft_from, craft_from, craft_from}
{'default:stick', craft_from, 'default:stick'},
}
})
end
@ -288,7 +306,7 @@ xconnected.register_pane = function( name, tiles, craft_from, def )
sunlight_propagates = true,
use_texture_alpha = true,
sounds = default.node_sound_glass_defaults(),
groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3, pane=1},
groups = {snappy=3, cracky=3, oddly_breakable_by_hand=3},
};
end
xconnected.register( name,
@ -324,7 +342,7 @@ xconnected.register_wall = function( name, tiles, craft_from, def )
is_ground_content = false,
sunlight_propagates = true,
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, stone=1, pane=1},
groups = {cracky=3, stone=2},
};
end
xconnected.register( name,
@ -360,7 +378,7 @@ xconnected.register_fence = function( name, tiles, craft_from, def )
is_ground_content = false,
sunlight_propagates = true,
sounds = default.node_sound_stone_defaults(),
groups = {snappy=2, cracky=3, oddly_breakable_by_hand=2, pane=1, flammable=2},
groups = {snappy=3, cracky=3, oddly_breakable_by_hand=3},
};
end
xconnected.register( name,