forked from ThomasMonroe314/ugxrealms
[xconnected] update
This commit is contained in:
parent
9bd903b3c4
commit
91faa71432
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,9 @@
|
||||
|
||||
xconnected = {}
|
||||
|
||||
-- if unifieddyes or morecolor is installed, use colorfacedir
|
||||
xconnected.with_color = minetest.get_modpath( "unifieddyes") or 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 +104,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 +143,12 @@ 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";
|
||||
if( xconnected.with_color ) 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 +171,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 +203,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 +301,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 +337,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 +373,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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user