many worldgen mods and gonna try technic now

This commit is contained in:
tangent committed 2026-09-13 03:30:48 -06:00
1 parent bac6ac94a3
commit 548749cb1a
4811 files changed
+163271 -1

No files matched your search

+133
View File
@@ -0,0 +1,133 @@
-- Code by Mossmanikin
-----------------------------------------------------------------------------------------------
-- TWiGS
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- *leaves --> twigs
output = "trunks:twig_1 2",
recipe = {{"group:leafdecay"}}
})
if minetest.get_modpath("moretrees") ~= nil then
minetest.register_craft({ -- moretrees_leaves --> twigs
output = "trunks:twig_1 2",
recipe = {{"group:moretrees_leaves"}}
})
minetest.register_craft({ -- except moretrees:palm_leaves
output = "moretrees:palm_leaves",
recipe = {{"moretrees:palm_leaves"}}
})
end
if minetest.get_modpath("bushes") ~= nil then
minetest.register_craft({ -- BushLeaves --> twigs
output = "trunks:twig_1 2",
recipe = {{"bushes:BushLeaves1"}}
})
minetest.register_craft({
output = "trunks:twig_1 2",
recipe = {{"bushes:BushLeaves2"}}
})
minetest.register_craft({ -- bushbranches --> twigs
output = "trunks:twig_1 4",
recipe = {{"bushes:bushbranches1"}}
})
minetest.register_craft({
output = "trunks:twig_1 4",
recipe = {{"bushes:bushbranches2"}}
})
minetest.register_craft({
output = "trunks:twig_1 4",
recipe = {{"bushes:bushbranches3"}}
})
minetest.register_craft({
output = "trunks:twig_1 4",
recipe = {{"bushes:bushbranches4"}}
})
end
minetest.register_craft({ -- twigs block --> twigs
output = "trunks:twig_1 8",
recipe = {{"trunks:twigs"}}
})
minetest.register_craft({ -- twigs_slab --> twigs
output = "trunks:twig_1 4",
recipe = {{"trunks:twigs_slab"}}
})
minetest.register_craft({ -- twigs_roof --> twigs
output = "trunks:twig_1 4",
recipe = {{"trunks:twigs_roof"}}
})
minetest.register_craft({ -- twigs_roof_corner --> twigs
output = "trunks:twig_1 3",
recipe = {{"trunks:twigs_roof_corner"}}
})
minetest.register_craft({ -- twigs_roof_corner_2 --> twigs
output = "trunks:twig_1 3",
recipe = {{"trunks:twigs_roof_corner_2"}}
})
-----------------------------------------------------------------------------------------------
-- STiCK
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- twig --> stick
output = "default:stick",
recipe = {{"trunks:twig_1"}}
})
-----------------------------------------------------------------------------------------------
-- TWiGS BLoCK
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- twigs --> twigs block
output = "trunks:twigs",
recipe = {
{"trunks:twig_1","trunks:twig_1","trunks:twig_1"},
{"trunks:twig_1", "" ,"trunks:twig_1"},
{"trunks:twig_1","trunks:twig_1","trunks:twig_1"},
}
})
-----------------------------------------------------------------------------------------------
-- TWiGS SLaBS
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- twigs blocks --> twigs_slabs
output = "trunks:twigs_slab 6",
recipe = {
{"trunks:twigs","trunks:twigs","trunks:twigs"},
}
})
-----------------------------------------------------------------------------------------------
-- TWiGS RooFS
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- twigs blocks --> twigs_roofs
output = "trunks:twigs_roof 4",
recipe = {
{"trunks:twigs",""},
{"","trunks:twigs"},
}
})
minetest.register_craft({
output = "trunks:twigs_roof 4",
recipe = {
{"","trunks:twigs"},
{"trunks:twigs",""},
}
})
-----------------------------------------------------------------------------------------------
-- TWiGS RooF CoRNeRS
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- twigs blocks --> twigs_roof_corners
output = "trunks:twigs_roof_corner 8",
recipe = {
{ "" ,"trunks:twigs", "" },
{"trunks:twigs", "" ,"trunks:twigs"},
}
})
-----------------------------------------------------------------------------------------------
-- TWiGS RooF CoRNeRS 2
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- twigs blocks --> twigs_roof_corner_2's
output = "trunks:twigs_roof_corner_2 8",
recipe = {
{"trunks:twigs", "" ,"trunks:twigs"},
{ "" ,"trunks:twigs", "" },
}
})
@@ -0,0 +1,510 @@
-- Code by Mossmanikin, Neuromancer, and others
-----------------------------------------------------------------------------------------------
-- TWiGS
-----------------------------------------------------------------------------------------------
function check_node_buildable_to(pos)
local node = minetest.get_node(pos)
local def = minetest.registered_nodes[node.name]
if def then
return def.buildable_to
end
end
abstract_trunks.place_twig = function(pos)
local twig_size = math.random(1,27)
local right_here = {x=pos.x , y=pos.y+1, z=pos.z }
local north = {x=pos.x , y=pos.y+1, z=pos.z+1}
local north_east = {x=pos.x+1, y=pos.y+1, z=pos.z+1}
local east = {x=pos.x+1, y=pos.y+1, z=pos.z }
local south_east = {x=pos.x+1, y=pos.y+1, z=pos.z-1}
local south = {x=pos.x , y=pos.y+1, z=pos.z-1}
local south_west = {x=pos.x-1, y=pos.y+1, z=pos.z-1}
local west = {x=pos.x-1, y=pos.y+1, z=pos.z }
local north_west = {x=pos.x-1, y=pos.y+1, z=pos.z+1}
-- small twigs
if twig_size <= 16 then
minetest.swap_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)})
end
-- big twig 1
if twig_size == 17 then
if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z+1})
or check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z})) then
if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_5"})
end
if check_node_buildable_to(north_east) then
minetest.swap_node(north_east, {name="trunks:twig_7"})
end
if check_node_buildable_to(east) then
minetest.swap_node(east, {name="trunks:twig_8"})
end
end
elseif twig_size == 18 then
if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z-1})
or check_node_buildable_to({x=pos.x,y=pos.y,z=pos.z-1})) then
if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_5", param2=1})
end
if check_node_buildable_to(south_east) then
minetest.swap_node(south_east, {name="trunks:twig_7", param2=1})
end
if check_node_buildable_to(south) then
minetest.swap_node(south, {name="trunks:twig_8", param2=1})
end
end
elseif twig_size == 19 then
if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z-1})
or check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z})) then
if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_5", param2=2})
end
if check_node_buildable_to(south_west) then
minetest.swap_node(south_west, {name="trunks:twig_7", param2=2})
end
if check_node_buildable_to(west) then
minetest.swap_node(west, {name="trunks:twig_8", param2=2})
end
end
elseif twig_size == 20 then
if not (check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z+1})
or check_node_buildable_to({x=pos.x,y=pos.y,z=pos.z+1})) then
if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_5", param2=3})
end
if check_node_buildable_to(north_west) then
minetest.swap_node(north_west, {name="trunks:twig_7", param2=3})
end
if check_node_buildable_to(north) then
minetest.swap_node(north, {name="trunks:twig_8", param2=3})
end
end
-- big twig 2
elseif twig_size == 21 then
if not (check_node_buildable_to({x=pos.x,y=pos.y,z=pos.z+1})
or check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z+1})) then
if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_9"})
end
if check_node_buildable_to(north) then
minetest.swap_node(north, {name="trunks:twig_10"})
end
if check_node_buildable_to(north_east) then
minetest.swap_node(north_east, {name="trunks:twig_11"})
end
end
elseif twig_size == 22 then
if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z})
or check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z-1})) then
if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_9", param2=1})
end
if check_node_buildable_to(east) then
minetest.swap_node(east, {name="trunks:twig_10", param2=1})
end
if check_node_buildable_to(south_east) then
minetest.swap_node(south_east, {name="trunks:twig_11", param2=1})
end
end
elseif twig_size == 23 then
if not (check_node_buildable_to({x=pos.x,y=pos.y,z=pos.z-1})
or check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z-1})) then
if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_9", param2=2})
end
if check_node_buildable_to(south) then
minetest.swap_node(south, {name="trunks:twig_10", param2=2})
end
if check_node_buildable_to(south_west) then
minetest.swap_node(south_west, {name="trunks:twig_11", param2=2})
end
end
elseif twig_size == 24 then
if not (check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z})
or check_node_buildable_to({x=pos.x-1,y=pos.y,z=pos.z+1})) then
if check_node_buildable_to(right_here) then
minetest.swap_node(right_here, {name="trunks:twig_9", param2=3})
end
if check_node_buildable_to(west) then
minetest.swap_node(west, {name="trunks:twig_10", param2=3})
end
if check_node_buildable_to(north_west) then
minetest.swap_node(north_west, {name="trunks:twig_11", param2=3})
end
end
elseif twig_size <= 25 then
minetest.swap_node(right_here, {name="trunks:twig_"..math.random(12,13), param2=math.random(0,3)})
end
end
biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"},
max_count = 640,
rarity = 66,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"group:tree","ferns:fern_03","ferns:fern_02","ferns:fern_01"},
near_nodes_size = 3,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
},
abstract_trunks.place_twig
)
biome_lib.register_on_generate({
surface = {"default:water_source"},
max_count = 320,
rarity = 33,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"group:tree"},
near_nodes_size = 3,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
},
abstract_trunks.place_twig
)
-----------------------------------------------------------------------------------------------
-- TRuNKS
-----------------------------------------------------------------------------------------------
local TRuNKS = {
-- MoD TRuNK NR
{"default", "tree", 1},
{"default", "jungletree", 2},
{"default", "pine_tree", 12},
{"trees", "tree_conifer", 3},
{"trees", "tree_mangrove", 4},
{"trees", "tree_palm", 5},
{"moretrees", "apple_tree_trunk", 6},
{"moretrees", "beech_trunk", 7},
{"moretrees", "birch_trunk", 8},
{"moretrees", "fir_trunk", 9},
{"moretrees", "oak_trunk", 10},
{"moretrees", "palm_trunk", 11},
{"moretrees", "rubber_tree_trunk", 13},
{"moretrees", "rubber_tree_trunk_empty", 14},
{"moretrees", "sequoia_trunk", 15},
{"moretrees", "spruce_trunk", 16},
{"moretrees", "willow_trunk", 17},
}
for i in pairs(TRuNKS) do
local MoD = TRuNKS[i][1]
local TRuNK = TRuNKS[i][2]
local NR = TRuNKS[i][3]
local trunkname = MoD..":"..TRuNK
if minetest.get_modpath(MoD) ~= nil
and NR < 6 -- moretrees trunks allready have facedir
and minetest.registered_nodes[trunkname] then -- the node being called exists.
temptrunk = table.copy(minetest.registered_nodes[trunkname])
temptrunk.paramtype2 = "facedir"
minetest.register_node(":"..trunkname, temptrunk)
end
end
abstract_trunks.place_trunk = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local north = {x=pos.x, y=pos.y+1, z=pos.z+1}
local north2 = {x=pos.x, y=pos.y+1, z=pos.z+2}
local south = {x=pos.x, y=pos.y+1, z=pos.z-1}
local south2 = {x=pos.x, y=pos.y+1, z=pos.z-2}
local west = {x=pos.x-1, y=pos.y+1, z=pos.z}
local west2 = {x=pos.x-2, y=pos.y+1, z=pos.z}
local east = {x=pos.x+1, y=pos.y+1, z=pos.z}
local east2 = {x=pos.x+2, y=pos.y+1, z=pos.z}
if check_node_buildable_to(right_here) then -- instead of check_air = true,
for i in pairs(TRuNKS) do
local MoD = TRuNKS[i][1]
local TRuNK = TRuNKS[i][2]
local NR = TRuNKS[i][3]
local chance = math.random(1, 17)
local length = math.random(3,5)
if chance == NR then
local trunk_type = math.random(1,3)
if trunk_type == 1 then
if minetest.get_modpath(MoD) ~= nil then
minetest.swap_node(right_here, {name=MoD..":"..TRuNK})
else
minetest.swap_node(right_here, {name="default:tree"})
end
elseif trunk_type == 2 then
if minetest.get_modpath(MoD) ~= nil then
if check_node_buildable_to(north) then
minetest.swap_node(north, {name=MoD..":"..TRuNK, param2=4})
end
if length >= 4 and check_node_buildable_to(north2) then
minetest.swap_node(north2, {name=MoD..":"..TRuNK, param2=4})
end
minetest.swap_node(right_here, {name=MoD..":"..TRuNK, param2=4})
if check_node_buildable_to(south) then
minetest.swap_node(south, {name=MoD..":"..TRuNK, param2=4})
end
if length == 5 and check_node_buildable_to(south2) then
minetest.swap_node(south2, {name=MoD..":"..TRuNK, param2=4})
end
else
if check_node_buildable_to(north) then
minetest.swap_node(north, {name="default:tree", param2=4})
end
if length >= 4 and check_node_buildable_to(north2) then
minetest.swap_node(north2, {name="default:tree", param2=4})
end
minetest.swap_node(right_here, {name="default:tree", param2=4})
if check_node_buildable_to(south) then
minetest.swap_node(south, {name="default:tree", param2=4})
end
if length == 5 and check_node_buildable_to(south2) then
minetest.swap_node(south2, {name="default:tree", param2=4})
end
end
elseif trunk_type == 3 then
if minetest.get_modpath(MoD) ~= nil then
if check_node_buildable_to(west) then
minetest.swap_node(west, {name=MoD..":"..TRuNK, param2=12})
end
if length >= 4 and check_node_buildable_to(west2) then
minetest.swap_node(west2, {name=MoD..":"..TRuNK, param2=12})
end
minetest.swap_node(right_here, {name=MoD..":"..TRuNK, param2=12})
if check_node_buildable_to(east) then
minetest.swap_node(east, {name=MoD..":"..TRuNK, param2=12})
end
if length == 5 and check_node_buildable_to(east2) then
minetest.swap_node(east2, {name=MoD..":"..TRuNK, param2=12})
end
else
if check_node_buildable_to(west) then
minetest.swap_node(west, {name="default:tree", param2=12})
end
if length >= 4 and check_node_buildable_to(west2) then
minetest.swap_node(west2, {name="default:tree", param2=12})
end
minetest.swap_node(right_here, {name="default:tree", param2=12})
if check_node_buildable_to(east) then
minetest.swap_node(east, {name="default:tree", param2=12})
end
if length == 5 and check_node_buildable_to(east2) then
minetest.swap_node(east2, {name="default:tree", param2=12})
end
end
end
end
end
end
end
biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"},
max_count = 320, -- 320,
rarity = 99, -- 99,
min_elevation = 1,
max_elevation = 40,
avoid_nodes = {"group:tree"},
avoid_radius = 1,
near_nodes = {"group:tree","ferns:fern_03","ferns:fern_02","ferns:fern_01"},
near_nodes_size = 3,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
},
abstract_trunks.place_trunk
)
-----------------------------------------------------------------------------------------------
-- MoSS & FuNGuS -- on ground
-----------------------------------------------------------------------------------------------
abstract_trunks.grow_moss_on_ground = function(pos)
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
local moss_type = math.random(1,21)
local rot = math.random(0,3)
if moss_type == 1 then
minetest.swap_node(on_ground, {name="trunks:moss_with_fungus_"..rot, param2=1})
else
minetest.swap_node(on_ground, {name="trunks:moss_plain_"..rot, param2=1})
end
end
biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"},
max_count = 400,
rarity = 79,
min_elevation = 1,
max_elevation = 40,
near_nodes = {
"group:tree",
"ferns:fern_03",
"ferns:fern_02",
"ferns:fern_01"
},
near_nodes_size = 2,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -0.9,
},
abstract_trunks.grow_moss_on_ground
)
-----------------------------------------------------------------------------------------------
-- MoSS & FuNGuS -- on trunks
-----------------------------------------------------------------------------------------------
abstract_trunks.grow_moss_on_trunk = function(pos)
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
local at_side_n = {x=pos.x, y=pos.y, z=pos.z+1}
local at_side_e = {x=pos.x+1, y=pos.y, z=pos.z}
local at_side_s = {x=pos.x, y=pos.y, z=pos.z-1}
local at_side_w = {x=pos.x-1, y=pos.y, z=pos.z}
--if minetest.get_item_group(node_under.name, "tree") < 1 then
if check_node_buildable_to(on_ground) then
local moss_type = math.random(1,41)
local rot = math.random(0,3)
if moss_type == 1 then
minetest.swap_node(on_ground, {name="trunks:moss_with_fungus_"..rot, param2=1})
elseif moss_type < 22 then
minetest.swap_node(on_ground, {name="trunks:moss_plain_"..rot, param2=1})
end
end
if check_node_buildable_to(at_side_n) then
local moss_type = math.random(1,31) -- cliche of more moss at north
local rot = math.random(0,3)
if moss_type == 1 then
minetest.swap_node(at_side_n, {name="trunks:moss_with_fungus_"..rot, param2=5})
elseif moss_type < 22 then
minetest.swap_node(at_side_n, {name="trunks:moss_plain_"..rot, param2=5})
end
end
if check_node_buildable_to(at_side_e) then
local moss_type = math.random(1,41)
local rot = math.random(0,3)
if moss_type == 1 then
minetest.swap_node(at_side_e, {name="trunks:moss_with_fungus_"..rot, param2=3})
elseif moss_type < 22 then
minetest.swap_node(at_side_e, {name="trunks:moss_plain_"..rot, param2=3})
end
end
if check_node_buildable_to(at_side_s) then
local moss_type = math.random(1,41)
local rot = math.random(0,3)
if moss_type == 1 then
minetest.swap_node(at_side_s, {name="trunks:moss_with_fungus_"..rot, param2=4})
elseif moss_type < 22 then
minetest.swap_node(at_side_s, {name="trunks:moss_plain_"..rot, param2=4})
end
end
if check_node_buildable_to(at_side_w) then
local moss_type = math.random(1,41)
local rot = math.random(0,3)
if moss_type == 1 then
minetest.swap_node(at_side_w, {name="trunks:moss_with_fungus_"..rot, param2=2})
elseif moss_type < 22 then
minetest.swap_node(at_side_w, {name="trunks:moss_plain_"..rot, param2=2})
end
end
--end
end
biome_lib.register_on_generate({
surface = {
"default:tree",
"default:jungletree",
"default:pine_tree",
"trees:tree_conifer",
"trees:tree_mangrove",
--"trees:tree_palm",
"moretrees:apple_tree_trunk",
"moretrees:beech_trunk",
"moretrees:birch_trunk",
"moretrees:fir_trunk",
"moretrees:oak_trunk",
--"moretrees:palm_trunk",
"moretrees:rubber_tree_trunk",
"moretrees:rubber_tree_trunk_empty",
"moretrees:sequoia_trunk",
"moretrees:spruce_trunk",
"moretrees:willow_trunk",
"default:mossycobble"
},
max_count = 640,
rarity = 24,
min_elevation = 1,
max_elevation = 40,
plantlife_limit = -0.9,
check_air = false,
},
"abstract_trunks.grow_moss_on_trunk"
)
-----------------------------------------------------------------------------------------------
-- RooTS
-----------------------------------------------------------------------------------------------
abstract_trunks.grow_roots = function(pos)
local right_here = {x=pos.x , y=pos.y , z=pos.z }
local below = {x=pos.x , y=pos.y-1, z=pos.z }
local north = {x=pos.x , y=pos.y , z=pos.z+1}
local east = {x=pos.x+1, y=pos.y , z=pos.z }
local south = {x=pos.x , y=pos.y , z=pos.z-1}
local west = {x=pos.x-1, y=pos.y , z=pos.z }
local node_here = minetest.get_node(right_here)
local node_below = minetest.get_node(below)
for i in pairs(TRuNKS) do
local MoD = TRuNKS[i][1]
local TRuNK = TRuNKS[i][2]
if minetest.get_modpath(MoD) ~= nil
and node_here.name == MoD..":"..TRuNK
and string.find(node_below.name, "dirt")
and node_here.param2 == 0 then
if check_node_buildable_to(north) then
minetest.swap_node(north, {name="trunks:"..TRuNK.."root", param2=2})
end
if check_node_buildable_to(east) then
minetest.swap_node(east, {name="trunks:"..TRuNK.."root", param2=3})
end
if check_node_buildable_to(south) then
minetest.swap_node(south, {name="trunks:"..TRuNK.."root", param2=0})
end
if check_node_buildable_to(west) then
minetest.swap_node(west, {name="trunks:"..TRuNK.."root", param2=1})
end
end
end
end
biome_lib.register_on_generate({
surface = {"group:tree"},
max_count = 1000,
rarity = 1,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:dirt_with_grass"},
near_nodes_size = 1,
near_nodes_vertical = 1,
near_nodes_count = 1,
plantlife_limit = -1,
check_air = false,
},
"abstract_trunks.grow_roots"
)
+9
View File
@@ -0,0 +1,9 @@
-- Code by Mossmanikin & Neuromancer
abstract_trunks = {}
dofile(minetest.get_modpath("trunks").."/generating.lua")
dofile(minetest.get_modpath("trunks").."/nodes.lua")
dofile(minetest.get_modpath("trunks").."/crafting.lua")
abstract_trunks.loaded = true
@@ -0,0 +1,10 @@
# textdomain: trunks
Twig=
Moss=
Moss with Fungus=
Twigs Block=
Twigs Slab=
Twigs Roof=
Twigs Roof Corner 1=
Twigs Roof Corner 2=
@1 Root=
@@ -0,0 +1,10 @@
# textdomain: trunks
Twig=Zweig
Moss=Moos
Moss with Fungus=Moos mit Pilz
Twigs Block=Zweigblock
Twigs Slab=Zweigplatte
Twigs Roof=Zweigdach
Twigs Roof Corner 1=Zweigdachwinkel 1
Twigs Roof Corner 2=Zweigdachwinkel 2
@1 Root=Wurzel von @1
@@ -0,0 +1,10 @@
# textdomain: trunks
Twig=Branĉeto
Moss=Musko
Moss with Fungus=Musko kun Fungo
Twigs Block=Bloko de Branĉetoj
Twigs Slab=Slabo
Twigs Roof=Tegmento
Twigs Roof Corner 1=Tegmentangulo 1 de Branĉetoj
Twigs Roof Corner 2=Tegmentangulo 2 de Branĉetoj
@1 Root=@1 Radiko
@@ -0,0 +1,10 @@
# textdomain: trunks
Twig=Brindille
Moss=Mousse
Moss with Fungus=Mousse et champignons
Twigs Block=Bloc de brindilles
Twigs Slab=Dalle en brindilles
Twigs Roof=Toit de brindilles
Twigs Roof Corner 1=Angle de toit de brindilles 1
Twigs Roof Corner 2=Angle de toit de brindilles 2
@1 Root=Racine de @1
+3
View File
@@ -0,0 +1,3 @@
name = trunks
depends = default, biome_lib
optional_depends = bushes, ferns, moretrees, trees
+430
View File
@@ -0,0 +1,430 @@
-- Code by Mossmanikin & Neuromancer
-- support for i18n
local S = minetest.get_translator("trunks")
-----------------------------------------------------------------------------------------------
-- TWiGS
-----------------------------------------------------------------------------------------------
-- For compatibility with older stuff
minetest.register_alias("trunks:twig", "trunks:twig_1")
local flat_stick = {-1/2, -1/2, -1/2, 1/2, -7/16, 1/2}
local NoDe = { {1}, {2}, {3}, {4}, {5}, --[[{6},]] {7}, {8}, {9}, {10}, {11}, {12}, {13} }
for i in pairs(NoDe) do
local NR = NoDe[i][1]
local iNV = NR - 1
minetest.register_node("trunks:twig_"..NR, {
description = S("Twig"),
inventory_image = "trunks_twig_"..NR..".png",
wield_image = "trunks_twig_"..NR..".png",
drawtype = "nodebox",
tiles = {
"trunks_twig_"..NR..".png",
"trunks_twig_"..NR..".png^[transformFY", -- mirror
"trunks_twig_6.png" -- empty
},
use_texture_alpha = "clip",
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
sunlight_propagates = true,
buildable_to = true,
node_box = {type = "fixed", fixed = flat_stick},
groups = {
choppy=2,
oddly_breakable_by_hand=2,
flammable=3,
attached_node=1,
not_in_creative_inventory=iNV
},
is_ground_content = false,
drop = "trunks:twig_1",
sounds = default.node_sound_leaves_defaults(),
liquids_pointable = true,
on_place = function(itemstack, placer, pointed_thing)
local pt = pointed_thing
if not placer then return end
local playername = placer:get_player_name()
if minetest.is_protected(pt.above, playername) then
minetest.record_protection_violation(pt.above, playername)
return
end
local direction = minetest.dir_to_facedir(placer:get_look_dir())
if minetest.get_node(pt.above).name=="air" then
minetest.swap_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction})
if not minetest.is_creative_enabled(playername) then
itemstack:take_item()
end
return itemstack
end
end,
})
end
-----------------------------------------------------------------------------------------------
-- MoSS
-----------------------------------------------------------------------------------------------
-- wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
-- wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
-- wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
-- was local flat_moss = {-1/2, -1/2, -1/2, 1/2, -15/32, 1/2}
local cbox = {
type = "wallmounted",
wall_top = {-1/2, 1/2, -1/2, 1/2, 15/32, 1/2},
wall_bottom = {-1/2, -1/2, -1/2, 1/2, -15/32, 1/2},
wall_side = {-1/2, -1/2, -1/2, -15/32, 1/2, 1/2}
}
for r = 0, 3 do
local xform = ""
if r > 0 then xform = "^[transformR"..r*90 end
minetest.register_node("trunks:moss_plain_"..r, {
description = S("Moss"),
drawtype = "nodebox",
tiles = {"trunks_moss.png"..xform},
use_texture_alpha = "clip",
inventory_image = "trunks_moss.png",
wield_image = "trunks_moss.png",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
node_box = cbox,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node=1, not_in_creative_inventory = r},
sounds = default.node_sound_leaves_defaults(),
drop = "trunks:moss_plain_0",
})
-----------------------------------------------------------------------------------------------
-- MoSS & FuNGuS
-----------------------------------------------------------------------------------------------
minetest.register_node("trunks:moss_with_fungus_"..r, {
description = S("Moss with Fungus"),
drawtype = "nodebox",
tiles = {"trunks_moss_fungus.png"..xform},
inventory_image = "trunks_moss_fungus.png",
wield_image = "trunks_moss_fungus.png",
use_texture_alpha = "clip",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
node_box = cbox,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node=1, not_in_creative_inventory = r},
sounds = default.node_sound_leaves_defaults(),
drop = "trunks:moss_with_fungus_0",
})
end
minetest.register_alias("trunks:moss", "trunks:moss_plain_0")
minetest.register_alias("trunks:moss_fungus", "trunks:moss_with_fungus_0")
-----------------------------------------------------------------------------------------------
-- TWiGS BLoCK
-----------------------------------------------------------------------------------------------
minetest.register_alias("woodstuff:twigs", "trunks:twigs")
minetest.register_node("trunks:twigs", {
description = S("Twigs Block"),
paramtype2 = "facedir",
tiles = {"trunks_twigs.png"},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
})
-----------------------------------------------------------------------------------------------
-- TWiGS SLaB
-----------------------------------------------------------------------------------------------
minetest.register_alias("woodstuff:twigs_slab", "trunks:twigs_slab")
minetest.register_node("trunks:twigs_slab", {
description = S("Twigs Slab"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"trunks_twigs.png"},
node_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2},
},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
})
-----------------------------------------------------------------------------------------------
-- TWiGS RooF
-----------------------------------------------------------------------------------------------
minetest.register_alias("woodstuff:twigs_roof", "trunks:twigs_roof")
minetest.register_node("trunks:twigs_roof", {
description = S("Twigs Roof"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"trunks_twigs.png"},
node_box = {
type = "fixed",
-- { left, bottom, front, right, top, back }
fixed = {
{-1/2, 0, 0, 1/2, 1/2, 1/2},
{-1/2, -1/2, -1/2, 1/2, 0, 0},
}
},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
})
-----------------------------------------------------------------------------------------------
-- TWiGS RooF CoRNeR
-----------------------------------------------------------------------------------------------
minetest.register_alias("woodstuff:twigs_roof_corner", "trunks:twigs_roof_corner")
minetest.register_node("trunks:twigs_roof_corner", {
description = S("Twigs Roof Corner 1"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {
"trunks_twigs_corner.png",
"trunks_twigs_corner.png",
"trunks_twigs.png"
},
node_box = {
type = "fixed",
-- { left, bottom, front, right, top, back }
fixed = {
{-1/2, 0, 0, 0, 1/2, 1/2},
{0, -1/2, 0, 1/2, 0, 1/2},
{-1/2, -1/2, -1/2, 0, 0, 0},
}
},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
})
-----------------------------------------------------------------------------------------------
-- TWiGS RooF CoRNeR 2
-----------------------------------------------------------------------------------------------
minetest.register_alias("woodstuff:twigs_roof_corner_2", "trunks:twigs_roof_corner_2")
minetest.register_node("trunks:twigs_roof_corner_2", {
description = S("Twigs Roof Corner 2"),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {
"trunks_twigs_corner.png",
"trunks_twigs_corner.png",
"trunks_twigs.png"
},
node_box = {
type = "fixed",
-- { left, bottom, front, right, top, back }
fixed = {
{-1/2, -1/2, 0, 0, 0, 1/2},
{0, 0, 0, 1/2, 1/2, 1/2},
{-1/2, 0, -1/2, 0, 1/2, 0},
}
},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
})
local roof = "trunks:twigs_roof"
local corner = "trunks:twigs_roof_corner"
local corner_2 = "trunks:twigs_roof_corner_2"
minetest.register_abm({
nodenames = {roof},
interval = 1,
chance = 1,
action = function(pos)
local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z })
local node_west = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z })
local node_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1})
local node_south = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1})
-- corner 1
if ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner and node_north.param2 == 3))
then
minetest.swap_node(pos, {name=corner, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner and node_east.param2 == 0))
then
minetest.swap_node(pos, {name=corner, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner and node_south.param2 == 1))
then
minetest.swap_node(pos, {name=corner, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner and node_west.param2 == 2))
then
minetest.swap_node(pos, {name=corner, param2=3})
end
-- corner 2
if ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner_2 and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner_2 and node_north.param2 == 3))
then
minetest.swap_node(pos, {name=corner_2, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner_2 and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner_2 and node_east.param2 == 0))
then
minetest.swap_node(pos, {name=corner_2, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner_2 and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner_2 and node_south.param2 == 1))
then
minetest.swap_node(pos, {name=corner_2, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner_2 and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner_2 and node_west.param2 == 2))
then
minetest.swap_node(pos, {name=corner_2, param2=3})
end
end,
})
-- MM: The following stuff is just for testing purposes for now; no generating of roots.
-- I'm not satisfied with this; they should be either bigger or a different drawtype.
-----------------------------------------------------------------------------------------------
-- RooTS
-----------------------------------------------------------------------------------------------
local roots_cube = {-2/16, -1/2, -3/16, 2/16, 1/16, 1/2}
local roots_sheet = {0, -1/2, -1/2, 0, 1/16, 1/2}
local TRuNKS = {
-- MoD TRuNK
{"default", "tree" },
{"default", "jungletree" },
{"default", "pine_tree" },
{"trees", "tree_conifer" },
{"trees", "tree_mangrove" },
{"trees", "tree_palm" },
{"moretrees", "apple_tree_trunk" },
{"moretrees", "beech_trunk" },
{"moretrees", "birch_trunk" },
{"moretrees", "fir_trunk" },
{"moretrees", "oak_trunk" },
{"moretrees", "palm_trunk" },
{"moretrees", "rubber_tree_trunk" },
{"moretrees", "rubber_tree_trunk_empty" },
{"moretrees", "sequoia_trunk" },
{"moretrees", "spruce_trunk" },
{"moretrees", "willow_trunk" },
}
for i in pairs(TRuNKS) do
local MoD = TRuNKS[i][1]
local TRuNK = TRuNKS[i][2]
if minetest.get_modpath(MoD) ~= nil then
local node = minetest.registered_nodes[MoD..":"..TRuNK]
if node then
local des = node.description
minetest.register_node("trunks:"..TRuNK.."root", {
description = S("@1 Root", des),
paramtype = "light",
paramtype2 = "facedir",
tiles = {
--[[top]] MoD.."_"..TRuNK..".png",
--[[bottom]] MoD.."_"..TRuNK..".png",
--[[right]] MoD.."_"..TRuNK..".png^trunks_root_mask.png^[makealpha:0,0,0",
--[[left]] MoD.."_"..TRuNK..".png^trunks_root_mask.png^[transformFX^[makealpha:0,0,0",
--[[back]] MoD.."_"..TRuNK..".png",
--[[front]] MoD.."_"..TRuNK..".png"
},
use_texture_alpha = "clip",
drawtype = "nodebox",
selection_box = {type = "fixed", fixed = roots_cube},
node_box = {type = "fixed", fixed = roots_sheet},
groups = {
tree=1,
snappy=1,
choppy=2,
oddly_breakable_by_hand=1,
flammable=2,
attached_node = 1
--not_in_creative_inventory=1 -- atm in inv for testing
},
is_ground_content = false,
--drop = "trunks:twig_1", -- not sure about this yet
sounds = default.node_sound_wood_defaults(),
})
else
minetest.log("error", string.format("[Trunks] warning: tree type '%s:%s' not found", MoD, TRuNK))
end
end
end
minetest.register_alias("trunks:pine_trunkroot", "trunks:pine_treeroot")
-- convert moss to wallmounted mode so that attached_node works properly.
local fdirtowall = {
[0] = 1,
[1] = 5,
[2] = 4,
[3] = 3,
[4] = 2,
}
minetest.register_lbm({
name = "trunks:convert_moss_wallmounted",
label = "Convert moss to wallmounted mode",
run_at_every_load = true,
nodenames = {"trunks:moss", "trunks:moss_fungus"},
action = function(pos, node)
local basedir = math.floor(node.param2 / 4)
local rot = node.param2 % 4
local newname = node.name == "trunks:moss_fungus" and "trunks:moss_with_fungus" or "trunks:moss_plain"
minetest.set_node(pos, {name = newname.."_"..rot, param2 = fdirtowall[basedir] })
end
})
@@ -0,0 +1,34 @@
-------------------------------------------------------------
Credit for textures of "trunks"
-------------------------------------------------------------
(If more than one author is listed the names are in alphabetical order)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOLDER TEXTURE AUTHORS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
../trunks/textures trunks_moss.png Neuromancer
trunks_moss_fungus.png Neuromancer
trunks_twig_1.png Mossmanikin
trunks_twig_2.png Mossmanikin, Neuromancer
trunks_twig_3.png Mossmanikin, Neuromancer
trunks_twig_4.png Mossmanikin, Neuromancer
trunks_twig_5.png Mossmanikin, Neuromancer
(trunks_twig_6.png) (Mossmanikin)
trunks_twig_7.png Mossmanikin, Neuromancer
trunks_twig_8.png Mossmanikin, Neuromancer
trunks_twig_9.png Mossmanikin, Neuromancer
trunks_twig_10.png Mossmanikin, Neuromancer
trunks_twig_11.png Mossmanikin, Neuromancer
trunks_twigs.png Mossmanikin
trunks_twigs_corner.png Mossmanikin
trunks_twigs_top.png Mossmanikin
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
../trunks/textures/old & unused comboSticks.png Mossmanikin, Neuromancer
comboSticks_2.png Mossmanikin, Neuromancer
trunks_twig_1e.png Mossmanikin, Neuromancer
trunks_twig_1n.png Mossmanikin, Neuromancer
trunks_twig_2n.png Mossmanikin, Neuromancer
trunks_twig_3n.png Mossmanikin, Neuromancer
trunks_twig_4n.png Mossmanikin, Neuromancer
trunks_twig_5-8.png Mossmanikin, Neuromancer
trunks_twig_9-12.png Mossmanikin, Neuromancer
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B