Merge pull request #7 from VanessaE/master
use pilzadam's clone-node method to modify trunks
This commit is contained in:
commit
1f663b7700
@ -1,7 +1,18 @@
|
|||||||
-- Code by Mossmanikin & Neuromancer
|
-- Code by Mossmanikin, Neuromancer, and others
|
||||||
|
|
||||||
|
local function clone_node(name)
|
||||||
|
node2={}
|
||||||
|
node=minetest.registered_nodes[name]
|
||||||
|
for k,v in pairs(node) do
|
||||||
|
node2[k]=v
|
||||||
|
end
|
||||||
|
return node2
|
||||||
|
end
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
-- TWiGS
|
-- TWiGS
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
abstract_trunks.place_twig = function(pos)
|
abstract_trunks.place_twig = function(pos)
|
||||||
local twig_size = math.random(1,27)
|
local twig_size = math.random(1,27)
|
||||||
|
|
||||||
@ -218,27 +229,10 @@ for i in pairs(TRuNKS) do
|
|||||||
if minetest.get_modpath(MoD) ~= nil
|
if minetest.get_modpath(MoD) ~= nil
|
||||||
and NR < 6 then -- moretrees trunks allready have facedir
|
and NR < 6 then -- moretrees trunks allready have facedir
|
||||||
|
|
||||||
local des = minetest.registered_nodes[MoD..":"..TRuNK].description
|
trunkname = MoD..":"..TRuNK
|
||||||
local par = minetest.registered_nodes[MoD..":"..TRuNK].paramtype
|
temptrunk = clone_node(trunkname)
|
||||||
local tls = minetest.registered_nodes[MoD..":"..TRuNK].tiles
|
temptrunk.paramtype2 = "facedir"
|
||||||
local tli = minetest.registered_nodes[MoD..":"..TRuNK].tile_images
|
minetest.register_node(":"..trunkname, temptrunk)
|
||||||
-- local igc = minetest.registered_nodes[MoD..":"..TRuNK].is_ground_content
|
|
||||||
local grp = minetest.registered_nodes[MoD..":"..TRuNK].groups
|
|
||||||
-- local drp = minetest.registered_nodes[MoD..":"..TRuNK].drop
|
|
||||||
local snd = minetest.registered_nodes[MoD..":"..TRuNK].sounds
|
|
||||||
|
|
||||||
minetest.register_node(":"..MoD..":"..TRuNK, {
|
|
||||||
description = des,
|
|
||||||
paramtype = par,
|
|
||||||
paramtype2 = "facedir", -- main change for lying trunks
|
|
||||||
tiles = tls,
|
|
||||||
tile_images = tli,
|
|
||||||
-- is_ground_content = igc,
|
|
||||||
groups = grp,
|
|
||||||
-- drop = drp,
|
|
||||||
sounds = snd,
|
|
||||||
})
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user