diff --git a/LICENSE b/LICENSE index d021cb5..dba3244 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,9 @@ For the code, Ironzorg's textures, and everything else: WTFPL -For all of my own textures: CC-By-SA 3.0 + +For Mossmannikin's mods (Ferns, Dryplans, and the components +from the Undergrowth modpack), and all of my own textures: +CC-By-SA 3.0 ---------- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE diff --git a/along_shore/depends.txt b/along_shore/depends.txt new file mode 100644 index 0000000..e27a0d0 --- /dev/null +++ b/along_shore/depends.txt @@ -0,0 +1,3 @@ +default +plants_lib +flowers_plus? \ No newline at end of file diff --git a/along_shore/init.lua b/along_shore/init.lua new file mode 100644 index 0000000..719d324 --- /dev/null +++ b/along_shore/init.lua @@ -0,0 +1,9 @@ +----------------------------------------------------------------------------------------------- +local title = "Along the Shore" +local version = "0.0.4" +local mname = "along_shore" +----------------------------------------------------------------------------------------------- + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/along_shore/textures/along_shore_seaweed_1Darker.png b/along_shore/textures/along_shore_seaweed_1Darker.png new file mode 100644 index 0000000..7c55926 Binary files /dev/null and b/along_shore/textures/along_shore_seaweed_1Darker.png differ diff --git a/along_shore/textures/credit_textures.txt b/along_shore/textures/credit_textures.txt new file mode 100644 index 0000000..89b4ce7 --- /dev/null +++ b/along_shore/textures/credit_textures.txt @@ -0,0 +1,30 @@ +------------------------------------------------------------- +Credit for textures of "along_shore" +------------------------------------------------------------- +(If more than one author is listed the names are in alphabetical order) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +FOLDER TEXTURE AUTHORS +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../along_shore/textures along_shore_seaweed_1Darker.png Neuromancer, VanessaE +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../along_shore/textures/old (along_shore_empty.png) (Mossmanikin) + along_shore_lilypads_1.png Mossmanikin, Neuromancer + along_shore_lilypads_2.png Mossmanikin, Neuromancer + along_shore_lilypads_3.png Mossmanikin, Neuromancer + along_shore_lilypads_4.png Mossmanikin, Neuromancer + along_shore_pondscum_1.png Neuromancer + along_shore_seaweed_1.png Neuromancer, VanessaE + along_shore_seaweed_2.png Mossmanikin, Neuromancer, VanessaE + along_shore_seaweed_3.png Mossmanikin, Neuromancer, VanessaE + along_shore_seaweed_4.png Mossmanikin, Neuromancer, VanessaE + flowers_seaweed.png Neuromancer, VanessaE + flowers_waterlily.png Mossmanikin, VanessaE + flowers_waterlily_22.5.png Mossmanikin, VanessaE + flowers_waterlily_45.png Mossmanikin, VanessaE + flowers_waterlily_67.5.png Mossmanikin, VanessaE + lillypad3Flower16x.png Neuromancer + LillyPad3x16.png Neuromancer + lillyPad5x16.png Neuromancer + MultiLilly16x.png Neuromancer + pondscum16xc.png Neuromancer +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/along_shore/textures/old/LillyPad3x16.png b/along_shore/textures/old/LillyPad3x16.png new file mode 100644 index 0000000..f121ec1 Binary files /dev/null and b/along_shore/textures/old/LillyPad3x16.png differ diff --git a/along_shore/textures/old/MultiLilly16x.png b/along_shore/textures/old/MultiLilly16x.png new file mode 100644 index 0000000..5a99694 Binary files /dev/null and b/along_shore/textures/old/MultiLilly16x.png differ diff --git a/along_shore/textures/old/along_shore_empty.png b/along_shore/textures/old/along_shore_empty.png new file mode 100644 index 0000000..c682453 Binary files /dev/null and b/along_shore/textures/old/along_shore_empty.png differ diff --git a/along_shore/textures/old/along_shore_lilypads_1.png b/along_shore/textures/old/along_shore_lilypads_1.png new file mode 100644 index 0000000..186bb31 Binary files /dev/null and b/along_shore/textures/old/along_shore_lilypads_1.png differ diff --git a/along_shore/textures/old/along_shore_lilypads_2.png b/along_shore/textures/old/along_shore_lilypads_2.png new file mode 100644 index 0000000..6ad36ce Binary files /dev/null and b/along_shore/textures/old/along_shore_lilypads_2.png differ diff --git a/along_shore/textures/old/along_shore_lilypads_3.png b/along_shore/textures/old/along_shore_lilypads_3.png new file mode 100644 index 0000000..a7a7931 Binary files /dev/null and b/along_shore/textures/old/along_shore_lilypads_3.png differ diff --git a/along_shore/textures/old/along_shore_lilypads_4.png b/along_shore/textures/old/along_shore_lilypads_4.png new file mode 100644 index 0000000..93d2030 Binary files /dev/null and b/along_shore/textures/old/along_shore_lilypads_4.png differ diff --git a/along_shore/textures/old/along_shore_pondscum_1.png b/along_shore/textures/old/along_shore_pondscum_1.png new file mode 100644 index 0000000..18b1879 Binary files /dev/null and b/along_shore/textures/old/along_shore_pondscum_1.png differ diff --git a/along_shore/textures/old/along_shore_seaweed_1.png b/along_shore/textures/old/along_shore_seaweed_1.png new file mode 100644 index 0000000..51f791d Binary files /dev/null and b/along_shore/textures/old/along_shore_seaweed_1.png differ diff --git a/along_shore/textures/old/along_shore_seaweed_2.png b/along_shore/textures/old/along_shore_seaweed_2.png new file mode 100644 index 0000000..a3195f5 Binary files /dev/null and b/along_shore/textures/old/along_shore_seaweed_2.png differ diff --git a/along_shore/textures/old/along_shore_seaweed_3.png b/along_shore/textures/old/along_shore_seaweed_3.png new file mode 100644 index 0000000..b791ee9 Binary files /dev/null and b/along_shore/textures/old/along_shore_seaweed_3.png differ diff --git a/along_shore/textures/old/along_shore_seaweed_4.png b/along_shore/textures/old/along_shore_seaweed_4.png new file mode 100644 index 0000000..2fccd04 Binary files /dev/null and b/along_shore/textures/old/along_shore_seaweed_4.png differ diff --git a/along_shore/textures/old/flowers_seaweed.png b/along_shore/textures/old/flowers_seaweed.png new file mode 100644 index 0000000..51f791d Binary files /dev/null and b/along_shore/textures/old/flowers_seaweed.png differ diff --git a/along_shore/textures/old/flowers_waterlily.png b/along_shore/textures/old/flowers_waterlily.png new file mode 100644 index 0000000..7653409 Binary files /dev/null and b/along_shore/textures/old/flowers_waterlily.png differ diff --git a/along_shore/textures/old/flowers_waterlily_22.5.png b/along_shore/textures/old/flowers_waterlily_22.5.png new file mode 100644 index 0000000..860f180 Binary files /dev/null and b/along_shore/textures/old/flowers_waterlily_22.5.png differ diff --git a/along_shore/textures/old/flowers_waterlily_45.png b/along_shore/textures/old/flowers_waterlily_45.png new file mode 100644 index 0000000..c73a6f4 Binary files /dev/null and b/along_shore/textures/old/flowers_waterlily_45.png differ diff --git a/along_shore/textures/old/flowers_waterlily_67.5.png b/along_shore/textures/old/flowers_waterlily_67.5.png new file mode 100644 index 0000000..29f0ee8 Binary files /dev/null and b/along_shore/textures/old/flowers_waterlily_67.5.png differ diff --git a/along_shore/textures/old/lillyPad5x16.png b/along_shore/textures/old/lillyPad5x16.png new file mode 100644 index 0000000..20aa209 Binary files /dev/null and b/along_shore/textures/old/lillyPad5x16.png differ diff --git a/along_shore/textures/old/lillypad3Flower16x.png b/along_shore/textures/old/lillypad3Flower16x.png new file mode 100644 index 0000000..0c581f1 Binary files /dev/null and b/along_shore/textures/old/lillypad3Flower16x.png differ diff --git a/along_shore/textures/old/pondscum16xc.png b/along_shore/textures/old/pondscum16xc.png new file mode 100644 index 0000000..18b1879 Binary files /dev/null and b/along_shore/textures/old/pondscum16xc.png differ diff --git a/bushes/depends.txt b/bushes/depends.txt new file mode 100644 index 0000000..bde0bdf --- /dev/null +++ b/bushes/depends.txt @@ -0,0 +1,2 @@ +default +plants_lib \ No newline at end of file diff --git a/bushes/init.lua b/bushes/init.lua new file mode 100644 index 0000000..3d52c3d --- /dev/null +++ b/bushes/init.lua @@ -0,0 +1,258 @@ +-- Bushes Mod by Mossmanikin, Evergreen, & Neuromancer +-- The initial code for this was taken from Mossmanikin's Grasses Mod, then heavilly modified by Neuromancer for this mod. +-- Mossmanikin also greatly helped with providing samples for coding. +-- bush leaf textures are cc-by-sa 3.0. from VannessaE's moretrees mod. (Leaf texture created by RealBadAngel or VanessaE) +-- Branch textures created by Neuromancer. +-- Licence for Code and Non-Bush leaf code is WTFPL. + + abstract_bushes = {} + + minetest.register_node("bushes:youngtree2_bottom", { + description = "youngtree2Bottom", + drawtype="nodebox", + tiles = {"youngtree2trunk.png"}, + inventory_image = "youngtree2trunk.png", + wield_image = "youngtree2trunk.png", +paramtype = "light", + walkable = false, + is_ground_content = true, +node_box = { + type = "fixed", + fixed = { + --{0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000}, --NodeBox 1 + {-0.0612,-0.500000,-0.500000,0.0612,0.500000,-0.375000}, --NodeBox 1 + } +}, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + + local BushBranchCenter = { {1,1}, {3,2} } +for i in pairs(BushBranchCenter) do + local Num = BushBranchCenter[i][1] + local TexNum = BushBranchCenter[i][2] + minetest.register_node("bushes:bushbranches"..Num, { + description = "Bush Branches "..Num, + drawtype = "nodebox", + tiles = { + "bushes_leaves_"..TexNum..".png", + "bushes_branches_center_"..TexNum..".png" + }, + node_box = { + type = "fixed", + fixed = { + {0, -1/2, -1/2, -1/4, 1/2, 1/2}, + {0, -1/2, -1/2, 1/4, 1/2, 1/2} + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "bushes_branches_center_"..TexNum..".png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = { + -- tree=1, -- MM: disabled because some recipes use group:tree for trunks + snappy=3, + flammable=2, + leaves=1 + }, + sounds = default.node_sound_leaves_defaults(), + }) +end + +local BushBranchSide = { {2,1}, {4,2} } +for i in pairs(BushBranchSide) do + local Num = BushBranchSide[i][1] + local TexNum = BushBranchSide[i][2] + minetest.register_node("bushes:bushbranches"..Num, { + description = "Bush Branches "..Num, + drawtype = "nodebox", + tiles = { +--[[top]] "bushes_leaves_"..TexNum..".png", +--[[bottom]]"bushes_branches_center_"..TexNum..".png", +--[[right]] "bushes_branches_left_"..TexNum..".png", +--[[left]] "bushes_branches_right_"..TexNum..".png", -- MM: We could also mirror the previous here, +--[[back]] "bushes_branches_center_"..TexNum..".png",-- unless U really want 'em 2 B different +--[[front]] "bushes_branches_right_"..TexNum..".png" + }, + node_box = { + type = "fixed", + fixed = { +-- { left , bottom , front, right , top , back } + {0.137748,-0.491944, 0.5 ,-0.125000,-0.179444,-0.007790}, --NodeBox 1 + {0.262748,-0.185995, 0.5 ,-0.237252, 0.126505,-0.260269}, --NodeBox 2 + {0.500000, 0.125000, 0.5 ,-0.500000, 0.500000,-0.500000}, --NodeBox 3 + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "bushes_branches_right_"..TexNum..".png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = { + -- tree=1, -- MM: disabled because some recipes use group:tree for trunks + snappy=3, + flammable=2, + leaves=1 + }, + sounds = default.node_sound_leaves_defaults(), + }) +end + +local BushLeafNode = { {1}, {2}} +for i in pairs(BushLeafNode) do + local Num = BushLeafNode[i][1] + minetest.register_node("bushes:BushLeaves"..Num, { + description = "Bush Leaves "..Num, + drawtype = "allfaces_optional", + tiles = {"bushes_leaves_"..Num..".png"}, + inventory_image = "bushes_leaves_"..Num..".png", + paramtype = "light", + groups = { -- MM: Should we add leafdecay? + snappy=3, + flammable=2, + attached_node=1 + }, + sounds = default.node_sound_leaves_defaults(), + }) +end + +abstract_bushes.grow_bush = function(pos) + local leaf_type = math.random(1,2) + local bush_side_height = math.random(0,1) + local chance_of_bush_node_right = math.random(1,10) + if chance_of_bush_node_right> 5 then + local right_pos = {x=pos.x+1, y=pos.y+bush_side_height, z=pos.z} + abstract_bushes.grow_bush_node(right_pos,3,leaf_type) + end + local chance_of_bush_node_left = math.random(1,10) + if chance_of_bush_node_left> 5 then + bush_side_height = math.random(0,1) + local left_pos = {x=pos.x-1, y=pos.y+bush_side_height, z=pos.z} + abstract_bushes.grow_bush_node(left_pos,1,leaf_type) + end + local chance_of_bush_node_front = math.random(1,10) + if chance_of_bush_node_front> 5 then + bush_side_height = math.random(0,1) + local front_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z+1} + abstract_bushes.grow_bush_node(front_pos,2,leaf_type) + end + local chance_of_bush_node_back = math.random(1,10) + if chance_of_bush_node_back> 5 then + bush_side_height = math.random(0,1) + local back_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z-1} + abstract_bushes.grow_bush_node(back_pos,0,leaf_type) + end + +abstract_bushes.grow_bush_node(pos,5,leaf_type) +end + +abstract_bushes.grow_bush_node = function(pos,dir, leaf_type) + + + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} + + --local bush_branch_type = math.random(1,3) + --local bush_branch_type = 2 + + -- MM: I'm not sure if it's slower now than before... + if dir ~= 5 and leaf_type == 1 then + bush_branch_type = 2 + end + if dir ~= 5 and leaf_type == 2 then + bush_branch_type = 4 + end + if dir == 5 and leaf_type == 1 then + bush_branch_type = 1 + dir = 1 + end + if dir == 5 and leaf_type == 2 then + bush_branch_type = 3 + dir = 1 + end + + if minetest.get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.get_node(right_here).name == "default:junglegrass" then + minetest.add_node(right_here, {name="bushes:bushbranches"..bush_branch_type , param2=dir}) + --minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")") + minetest.add_node(above_right_here, {name="bushes:BushLeaves"..leaf_type}) + local chance_of_high_leaves = math.random(1,10) + if chance_of_high_leaves> 5 then + local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z} + --minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")") + minetest.add_node(two_above_right_here, {name="bushes:BushLeaves"..leaf_type}) + end + end +end + + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = 15, --10,15 + rarity = 101 - 4, --3,4 + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_bushes.grow_bush" +) + + abstract_bushes.grow_youngtree2 = function(pos) + local height = math.random(4,5) + abstract_bushes.grow_youngtree_node2(pos,height) +end + +abstract_bushes.grow_youngtree_node2 = function(pos, height) + + + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} + local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z} + local three_above_right_here = {x=pos.x, y=pos.y+4, z=pos.z} + + if minetest.get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.get_node(right_here).name == "default:junglegrass" then + if height == 4 then + local two_above_right_here_south = {x=pos.x, y=pos.y+3, z=pos.z-1} + local three_above_right_here_south = {x=pos.x, y=pos.y+4, z=pos.z-1} + minetest.add_node(right_here, {name="bushes:youngtree2_bottom"}) + minetest.add_node(above_right_here, {name="bushes:youngtree2_bottom"}) + minetest.add_node(two_above_right_here, {name="bushes:bushbranches2" , param2=2}) + minetest.add_node(two_above_right_here_south, {name="bushes:bushbranches2" , param2=0}) + minetest.add_node(three_above_right_here, {name="bushes:BushLeaves1" }) + minetest.add_node(three_above_right_here_south, {name="bushes:BushLeaves1" }) + end + + end +end + + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = 55, --10,15 + rarity = 101 - 4, --3,4 + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_bushes.grow_youngtree2" +) + + --http://dev.minetest.net/Node_Drawtypes \ No newline at end of file diff --git a/bushes/textures/bushes_branches_center_1.png b/bushes/textures/bushes_branches_center_1.png new file mode 100644 index 0000000..f059851 Binary files /dev/null and b/bushes/textures/bushes_branches_center_1.png differ diff --git a/bushes/textures/bushes_branches_center_2.png b/bushes/textures/bushes_branches_center_2.png new file mode 100644 index 0000000..2009b50 Binary files /dev/null and b/bushes/textures/bushes_branches_center_2.png differ diff --git a/bushes/textures/bushes_branches_left_1.png b/bushes/textures/bushes_branches_left_1.png new file mode 100644 index 0000000..e0f1ce6 Binary files /dev/null and b/bushes/textures/bushes_branches_left_1.png differ diff --git a/bushes/textures/bushes_branches_left_2.png b/bushes/textures/bushes_branches_left_2.png new file mode 100644 index 0000000..cb3e237 Binary files /dev/null and b/bushes/textures/bushes_branches_left_2.png differ diff --git a/bushes/textures/bushes_branches_right_1.png b/bushes/textures/bushes_branches_right_1.png new file mode 100644 index 0000000..e7762bb Binary files /dev/null and b/bushes/textures/bushes_branches_right_1.png differ diff --git a/bushes/textures/bushes_branches_right_2.png b/bushes/textures/bushes_branches_right_2.png new file mode 100644 index 0000000..55184a4 Binary files /dev/null and b/bushes/textures/bushes_branches_right_2.png differ diff --git a/bushes/textures/bushes_leaves_1.png b/bushes/textures/bushes_leaves_1.png new file mode 100644 index 0000000..d0bc984 Binary files /dev/null and b/bushes/textures/bushes_leaves_1.png differ diff --git a/bushes/textures/bushes_leaves_2.png b/bushes/textures/bushes_leaves_2.png new file mode 100644 index 0000000..c38a51d Binary files /dev/null and b/bushes/textures/bushes_leaves_2.png differ diff --git a/bushes/textures/old & unused/BlockBranch1.png b/bushes/textures/old & unused/BlockBranch1.png new file mode 100644 index 0000000..c3ba887 Binary files /dev/null and b/bushes/textures/old & unused/BlockBranch1.png differ diff --git a/bushes/textures/old & unused/BlockBranch1L.png b/bushes/textures/old & unused/BlockBranch1L.png new file mode 100644 index 0000000..08fbb66 Binary files /dev/null and b/bushes/textures/old & unused/BlockBranch1L.png differ diff --git a/bushes/textures/old & unused/BlockBranch1R.png b/bushes/textures/old & unused/BlockBranch1R.png new file mode 100644 index 0000000..58b9214 Binary files /dev/null and b/bushes/textures/old & unused/BlockBranch1R.png differ diff --git a/bushes/textures/old & unused/BushBranches1.png b/bushes/textures/old & unused/BushBranches1.png new file mode 100644 index 0000000..c02b7ab Binary files /dev/null and b/bushes/textures/old & unused/BushBranches1.png differ diff --git a/bushes/textures/old & unused/BushBranches1sm.png b/bushes/textures/old & unused/BushBranches1sm.png new file mode 100644 index 0000000..2ab7ca3 Binary files /dev/null and b/bushes/textures/old & unused/BushBranches1sm.png differ diff --git a/bushes/textures/old & unused/BushBranches1sm2.png b/bushes/textures/old & unused/BushBranches1sm2.png new file mode 100644 index 0000000..81005e1 Binary files /dev/null and b/bushes/textures/old & unused/BushBranches1sm2.png differ diff --git a/bushes/textures/old & unused/BushBranches1sm3.png b/bushes/textures/old & unused/BushBranches1sm3.png new file mode 100644 index 0000000..c626a1f Binary files /dev/null and b/bushes/textures/old & unused/BushBranches1sm3.png differ diff --git a/bushes/textures/old & unused/BushBranches1sm4.png b/bushes/textures/old & unused/BushBranches1sm4.png new file mode 100644 index 0000000..146ff08 Binary files /dev/null and b/bushes/textures/old & unused/BushBranches1sm4.png differ diff --git a/bushes/textures/old & unused/BushBranchesCenter.png b/bushes/textures/old & unused/BushBranchesCenter.png new file mode 100644 index 0000000..cf6f00a Binary files /dev/null and b/bushes/textures/old & unused/BushBranchesCenter.png differ diff --git a/bushes/textures/old & unused/BushBranchesSide1.png b/bushes/textures/old & unused/BushBranchesSide1.png new file mode 100644 index 0000000..ca1305c Binary files /dev/null and b/bushes/textures/old & unused/BushBranchesSide1.png differ diff --git a/bushes/textures/old & unused/BushBranchesSide2.png b/bushes/textures/old & unused/BushBranchesSide2.png new file mode 100644 index 0000000..41f0fc1 Binary files /dev/null and b/bushes/textures/old & unused/BushBranchesSide2.png differ diff --git a/bushes/textures/old & unused/blank.png b/bushes/textures/old & unused/blank.png new file mode 100644 index 0000000..06776a0 Binary files /dev/null and b/bushes/textures/old & unused/blank.png differ diff --git a/bushes/textures/old & unused/moretrees_pine_leaves3.png b/bushes/textures/old & unused/moretrees_pine_leaves3.png new file mode 100644 index 0000000..af34853 Binary files /dev/null and b/bushes/textures/old & unused/moretrees_pine_leaves3.png differ diff --git a/bushes/textures/youngtree2trunk.png b/bushes/textures/youngtree2trunk.png new file mode 100644 index 0000000..96a6322 Binary files /dev/null and b/bushes/textures/youngtree2trunk.png differ diff --git a/cavestuff/depends.txt b/cavestuff/depends.txt new file mode 100644 index 0000000..3a7daa1 --- /dev/null +++ b/cavestuff/depends.txt @@ -0,0 +1,2 @@ +default + diff --git a/cavestuff/init.lua b/cavestuff/init.lua new file mode 100644 index 0000000..f2bed1a --- /dev/null +++ b/cavestuff/init.lua @@ -0,0 +1,12 @@ +----------------------------------------------------------------------------------------------- +local title = "Cave Stuff" +local version = "0.0.3" +local mname = "cavestuff" +----------------------------------------------------------------------------------------------- + +dofile(minetest.get_modpath("cavestuff").."/nodes.lua") +dofile(minetest.get_modpath("cavestuff").."/mapgen.lua") + +----------------------------------------------------------------------------------------------- + +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") diff --git a/cavestuff/mapgen.lua b/cavestuff/mapgen.lua new file mode 100644 index 0000000..a91a2f0 --- /dev/null +++ b/cavestuff/mapgen.lua @@ -0,0 +1,52 @@ +--Map Generation Stuff + +minetest.register_on_generated(function(minp, maxp, seed) + if maxp.y >= 2 and minp.y <= 0 then + -- Generate pebbles + local perlin1 = minetest.get_perlin(329, 3, 0.6, 100) + -- Assume X and Z lengths are equal + local divlen = 16 + local divs = (maxp.x-minp.x)/divlen+1; + for divx=0,divs-1 do + for divz=0,divs-1 do + local x0 = minp.x + math.floor((divx+0)*divlen) + local z0 = minp.z + math.floor((divz+0)*divlen) + local x1 = minp.x + math.floor((divx+1)*divlen) + local z1 = minp.z + math.floor((divz+1)*divlen) + -- Determine pebble amount from perlin noise + local pebble_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 2 * 2) + -- Find random positions for pebbles based on this random + local pr = PseudoRandom(seed+1) + for i=0,pebble_amount do + local x = pr:next(x0, x1) + local z = pr:next(z0, z1) + -- Find ground level (0...15) + local ground_y = nil + for y=30,0,-1 do + if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then + ground_y = y + break + end + end + + if ground_y then + local p = {x=x,y=ground_y+1,z=z} + local nn = minetest.get_node(p).name + -- Check if the node can be replaced + if minetest.registered_nodes[nn] and + minetest.registered_nodes[nn].buildable_to then + nn = minetest.get_node({x=x,y=ground_y,z=z}).name + -- If desert sand, add dry shrub + if nn == "default:dirt_with_grass" then + minetest.set_node(p,{name="cavestuff:pebble_"..pr:next(1,2), param2=math.random(0,3)}) + elseif nn == "default:desert_sand" then + minetest.set_node(p,{name="cavestuff:desert_pebble_"..pr:next(1,2), param2=math.random(0,3)}) + end + end + end + + end + end + end + end +end) diff --git a/cavestuff/nodes.lua b/cavestuff/nodes.lua new file mode 100644 index 0000000..7327f70 --- /dev/null +++ b/cavestuff/nodes.lua @@ -0,0 +1,243 @@ +--Rocks + +minetest.register_node("cavestuff:pebble_1",{ + drawtype = "nodebox", + description = "Pebble", + tiles = {"undergrowth_pebble.png"}, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=3, stone=1}, + node_box = { + type = "fixed", + fixed = { +-- { left, bottom, front, right, top , back} + {-5/16, -2/16, -3/16, 1/16, -1/16, -1/16}, + {-4/16, -2/16, -4/16, 0 , -1/16, 0 }, +-- { left, bottom, front, right, top , back} + {-7/16, -7/16, -3/16, -6/16, -3/16, 1/16}, + {-6/16, -7/16, -4/16, -5/16, -3/16, 2/16}, + {-5/16, -7/16, -5/16, 3/16, -3/16, 3/16}, + {-4/16, -7/16, -6/16, 1/16, -3/16, -5/16}, + {-3/16, -7/16, 3/16, 3/16, -3/16, 4/16}, + { 0 , -7/16, 4/16, 3/16, -3/16, 5/16}, + { 3/16, -7/16, -4/16, 4/16, -3/16, 5/16}, + { 4/16, -7/16, -3/16, 5/16, -3/16, 4/16}, + { 5/16, -7/16, -1/16, 6/16, -3/16, 2/16}, +-- { left, bottom, front, right, top , back} + {-6/16, -8/16, -3/16, 3/16, -2/16, 0 }, + {-5/16, -8/16, -4/16, 2/16, -2/16, 1/16}, + {-4/16, -8/16, -5/16, 0 , -2/16, 2/16}, + {-2/16, -8/16, -2/16, 4/16, -2/16, 3/16}, + { 0 , -8/16, 3/16, 3/16, -2/16, 4/16}, + { 4/16, -8/16, -1/16, 5/16, -2/16, 2/16}, + }, + }, + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -6/16, 6/16, -1/16, 5/16}, + }, + on_place = function(itemstack, placer, pointed_thing) + -- place a random pebble node + local stack = ItemStack("cavestuff:pebble_"..math.random(1,2)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("cavestuff:pebble_1 "..itemstack:get_count()-(1-ret:get_count())) + end, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("cavestuff:pebble_2",{ + drawtype = "nodebox", + drop = "cavestuff:pebble_1", + tiles = {"undergrowth_pebble.png"}, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=3, stone=1, not_in_creative_inventory=1}, + node_box = { + type = "fixed", + fixed = { +-- { left, bottom, front, right, top , back} + {-5/16, -1/16, -3/16, 1/16, 0 , -1/16}, + {-4/16, -1/16, -4/16, 0 , 0 , 0 }, +-- { left, bottom, front, right, top , back} + {-7/16, -7/16, -3/16, -6/16, -2/16, 1/16}, + {-6/16, -7/16, -4/16, -5/16, -2/16, 2/16}, + {-5/16, -7/16, -5/16, 3/16, -2/16, 3/16}, + {-4/16, -7/16, -6/16, 1/16, -2/16, -5/16}, + {-3/16, -7/16, 3/16, 3/16, -2/16, 4/16}, + { 0 , -7/16, 4/16, 3/16, -2/16, 5/16}, + { 3/16, -7/16, -4/16, 4/16, -2/16, 5/16}, + { 4/16, -7/16, -3/16, 5/16, -2/16, 4/16}, + { 5/16, -7/16, -1/16, 6/16, -2/16, 2/16}, +-- { left, bottom, front, right, top , back} + {-6/16, -8/16, -3/16, 3/16, -1/16, 0 }, + {-5/16, -8/16, -4/16, 2/16, -1/16, 1/16}, + {-4/16, -8/16, -5/16, 0 , -1/16, 2/16}, + {-2/16, -8/16, -2/16, 4/16, -1/16, 3/16}, + { 0 , -8/16, 3/16, 3/16, -1/16, 4/16}, + { 4/16, -8/16, -1/16, 5/16, -1/16, 2/16}, + }, + }, + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -6/16, 6/16, 0, 5/16}, + }, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("cavestuff:desert_pebble_1",{ + drawtype = "nodebox", + description = "Desert Pebble", + tiles = {"default_desert_stone.png"}, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=3, stone=1}, + node_box = { + type = "fixed", + fixed = { +-- { left, bottom, front, right, top , back} + {-5/16, -2/16, -3/16, 1/16, -1/16, -1/16}, + {-4/16, -2/16, -4/16, 0 , -1/16, 0 }, +-- { left, bottom, front, right, top , back} + {-7/16, -7/16, -3/16, -6/16, -3/16, 1/16}, + {-6/16, -7/16, -4/16, -5/16, -3/16, 2/16}, + {-5/16, -7/16, -5/16, 3/16, -3/16, 3/16}, + {-4/16, -7/16, -6/16, 1/16, -3/16, -5/16}, + {-3/16, -7/16, 3/16, 3/16, -3/16, 4/16}, + { 0 , -7/16, 4/16, 3/16, -3/16, 5/16}, + { 3/16, -7/16, -4/16, 4/16, -3/16, 5/16}, + { 4/16, -7/16, -3/16, 5/16, -3/16, 4/16}, + { 5/16, -7/16, -1/16, 6/16, -3/16, 2/16}, +-- { left, bottom, front, right, top , back} + {-6/16, -8/16, -3/16, 3/16, -2/16, 0 }, + {-5/16, -8/16, -4/16, 2/16, -2/16, 1/16}, + {-4/16, -8/16, -5/16, 0 , -2/16, 2/16}, + {-2/16, -8/16, -2/16, 4/16, -2/16, 3/16}, + { 0 , -8/16, 3/16, 3/16, -2/16, 4/16}, + { 4/16, -8/16, -1/16, 5/16, -2/16, 2/16}, + }, + }, + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -6/16, 6/16, -1/16, 5/16}, + }, + on_place = function(itemstack, placer, pointed_thing) + -- place a random pebble node + local stack = ItemStack("cavestuff:desert_pebble_"..math.random(1,2)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("cavestuff:desert_pebble_1 "..itemstack:get_count()-(1-ret:get_count())) + end, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("cavestuff:desert_pebble_2",{ + drawtype = "nodebox", + drop = "cavestuff:desert_pebble_1", + tiles = {"default_desert_stone.png"}, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=3, stone=1, not_in_creative__inventory=1}, + node_box = { + type = "fixed", + fixed = { +-- { left, bottom, front, right, top , back} + {-5/16, -1/16, -3/16, 1/16, 0 , -1/16}, + {-4/16, -1/16, -4/16, 0 , 0 , 0 }, +-- { left, bottom, front, right, top , back} + {-7/16, -7/16, -3/16, -6/16, -2/16, 1/16}, + {-6/16, -7/16, -4/16, -5/16, -2/16, 2/16}, + {-5/16, -7/16, -5/16, 3/16, -2/16, 3/16}, + {-4/16, -7/16, -6/16, 1/16, -2/16, -5/16}, + {-3/16, -7/16, 3/16, 3/16, -2/16, 4/16}, + { 0 , -7/16, 4/16, 3/16, -2/16, 5/16}, + { 3/16, -7/16, -4/16, 4/16, -2/16, 5/16}, + { 4/16, -7/16, -3/16, 5/16, -2/16, 4/16}, + { 5/16, -7/16, -1/16, 6/16, -2/16, 2/16}, +-- { left, bottom, front, right, top , back} + {-6/16, -8/16, -3/16, 3/16, -1/16, 0 }, + {-5/16, -8/16, -4/16, 2/16, -1/16, 1/16}, + {-4/16, -8/16, -5/16, 0 , -1/16, 2/16}, + {-2/16, -8/16, -2/16, 4/16, -1/16, 3/16}, + { 0 , -8/16, 3/16, 3/16, -1/16, 4/16}, + { 4/16, -8/16, -1/16, 5/16, -1/16, 2/16}, + }, + }, + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -6/16, 6/16, 0, 5/16}, + }, + sounds = default.node_sound_stone_defaults(), +}) + +--Staclactites + +minetest.register_node("cavestuff:stalactite_1",{ + drawtype="nodebox", + tiles = {"undergrowth_pebble.png"}, + groups = {cracky=3,attached_node=1}, + description = "Stalactite", + paramtype = "light", + paramtype2 = "wallmounted", + node_box = { + type = "fixed", + fixed = { + {-0.187500,0.425000,-0.150003,0.162500,0.500000,0.162500}, + {-0.112500,0.162500,-0.100000,0.087500,0.475000,0.087500}, + {-0.062500,-0.275000,-0.062500,0.062500,0.500000,0.062500}, + {-0.037500,-0.837500,0.037500,0.037500,0.500000,-0.025000}, + } + }, + + on_place = function(itemstack, placer, pointed_thing) + local pt = pointed_thing + if minetest.get_node(pt.under).name=="default:stone" + and minetest.get_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}).name=="air" + and minetest.get_node({x=pt.under.x, y=pt.under.y-2, z=pt.under.z}).name=="air" then + minetest.set_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}, {name="cavestuff:stalactite_"..math.random(1,3)}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + end + return itemstack + end, +}) + +minetest.register_node("cavestuff:stalactite_2",{ + drawtype="nodebox", + tiles = {"undergrowth_pebble.png"}, + groups = {cracky=3,attached_node=1,not_in_creative_inventory=1}, + drop = "cavestuff:stalactite_1", + paramtype = "light", + paramtype2 = "wallmounted", + node_box = { + type = "fixed", + fixed = { + {-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500}, + {-0.112500,0.112500,-0.100000,0.087500,0.475000,0.087500}, + {-0.062500,-0.675000,-0.062500,0.062500,0.500000,0.062500}, + {-0.037500,-0.975000,0.037500,0.037500,0.500000,-0.025000}, + } + }, +}) + +minetest.register_node("cavestuff:stalactite_3",{ + drawtype="nodebox", + tiles = {"undergrowth_pebble.png"}, + groups = {cracky=3,attached_node=1,not_in_creative_inventory=1}, + drop = "cavestuff:stalactite_1", + paramtype = "light", + paramtype2 = "wallmounted", + node_box = { + type = "fixed", + fixed = { + {-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500}, + {-0.112500,0.037500,-0.100000,0.087500,0.475000,0.087500}, + {-0.062500,-0.437500,-0.062500,0.062500,0.500000,0.062500}, + {-0.037500,-1.237500,0.037500,0.037500,0.500000,-0.025000}, + } + }, +}) + +--Stalagmites + + + diff --git a/cavestuff/textures/undergrowth_desert_pebble.png b/cavestuff/textures/undergrowth_desert_pebble.png new file mode 100644 index 0000000..f85dbbd Binary files /dev/null and b/cavestuff/textures/undergrowth_desert_pebble.png differ diff --git a/cavestuff/textures/undergrowth_pebble.png b/cavestuff/textures/undergrowth_pebble.png new file mode 100644 index 0000000..507778d Binary files /dev/null and b/cavestuff/textures/undergrowth_pebble.png differ diff --git a/dryplants/crafting.lua b/dryplants/crafting.lua new file mode 100644 index 0000000..69154b5 --- /dev/null +++ b/dryplants/crafting.lua @@ -0,0 +1,360 @@ +----------------------------------------------------------------------------------------------- +-- Dry Plants - Recipes 0.1.0 -- Short Grass -> Dirt +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Looked at code from: darkage, default, farming, sickle, stairs +-- Dependencies: default, farming +-- Supports: flint, stoneage, sumpf +----------------------------------------------------------------------------------------------- + +----------------------------------------------------------------------------------------------- +-- Short Grass +----------------------------------------------------------------------------------------------- +minetest.register_craft({ + output = "default:dirt", + recipe = { + {"dryplants:grass_short"}, + } +}) + +----------------------------------------------------------------------------------------------- +-- Cut Grass +----------------------------------------------------------------------------------------------- +-- grass recipes (remove roots) +minetest.register_craft({ + output = "dryplants:grass", + recipe = { + {"default:grass_1"}, + } +}) +minetest.register_craft({ + output = "dryplants:grass", + recipe = { + {"default:junglegrass"}, + } +}) +if minetest.get_modpath("sumpf") ~= nil then + minetest.register_craft({ + output = "dryplants:grass", + recipe = { + {"sumpf:gras"}, + } + }) +end + +----------------------------------------------------------------------------------------------- +-- Sickle +----------------------------------------------------------------------------------------------- +minetest.register_craft({ + output = "dryplants:sickle", + recipe = { + {"group:stone",""}, + {"", "default:stick"}, + {"default:stick",""} + } +}) +if minetest.get_modpath("flint") ~= nil then + minetest.register_craft({ + output = "dryplants:sickle", + recipe = { + {"flint:flintstone",""}, + {"", "default:stick"}, + {"default:stick",""} + } + }) +end +if minetest.get_modpath("stoneage") ~= nil then + minetest.register_craft({ + output = "dryplants:sickle", + recipe = { + {"stoneage:silex",""}, + {"", "default:stick"}, + {"default:stick",""} + } + }) +end + +----------------------------------------------------------------------------------------------- +-- Hay +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ + type = "cooking", + output = "dryplants:hay", + recipe = "dryplants:grass", + cooktime = 2, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:hay", + burntime = 1, +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- papyrus -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"default:papyrus","default:papyrus"}, + {"default:papyrus","default:papyrus"}, + } +}) +minetest.register_craft({ -- reedmace_sapling -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"dryplants:reedmace_sapling","dryplants:reedmace_sapling"}, + {"dryplants:reedmace_sapling","dryplants:reedmace_sapling"}, + } +}) +minetest.register_craft({ -- reedmace_top -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"dryplants:reedmace_top","dryplants:reedmace_top"}, + {"dryplants:reedmace_top","dryplants:reedmace_top"}, + } +}) +minetest.register_craft({ -- reedmace -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"dryplants:reedmace","dryplants:reedmace"}, + {"dryplants:reedmace","dryplants:reedmace"}, + } +}) +minetest.register_craft({ -- reedmace_bottom -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"dryplants:reedmace_bottom","dryplants:reedmace_bottom"}, + {"dryplants:reedmace_bottom","dryplants:reedmace_bottom"}, + } +}) + + +local ReeD = { + {"wetreed"}, + {"reed"} +} +for i in pairs(ReeD) do + local reed = "dryplants:"..ReeD[i][1] + local slab = reed.."_slab" + local roof = reed.."_roof" + local corner = roof.."_corner" + local corner_2 = corner.."_2" +----------------------------------------------------------------------------------------------- +-- Block +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- slab -> block + output = reed, + recipe = { + {slab}, + {slab}, + } + }) + minetest.register_craft({ -- roof -> block + output = reed, + recipe = { + {roof}, + {roof}, + } + }) + minetest.register_craft({ -- corner -> block + type = "shapeless", + output = reed.." 3", + recipe = {corner,corner,corner,corner,corner,corner,corner,corner}, -- 8x + }) + minetest.register_craft({ -- corner_2 -> block + type = "shapeless", + output = reed.." 3", + recipe = {corner_2,corner_2,corner_2,corner_2,corner_2,corner_2,corner_2,corner_2}, -- 8x + }) +----------------------------------------------------------------------------------------------- +-- Slab +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- block -> slab + output = slab.." 6", + recipe = { + {reed,reed,reed}, + } + }) + minetest.register_craft({ -- roof -> slab + output = slab, + recipe = { + {roof}, + } + }) + minetest.register_craft({ -- corner -> slab + output = slab.." 3", + recipe = { + {corner,corner}, + {corner,corner}, + } + }) + minetest.register_craft({ -- corner_2 -> slab + output = slab.." 3", + recipe = { + {corner_2,corner_2}, + {corner_2,corner_2}, + } + }) +----------------------------------------------------------------------------------------------- +-- Roof +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- block -> roof + output = roof.." 4", + recipe = { + {reed,""}, + {"",reed}, + } + }) + minetest.register_craft({ -- block -> roof + output = roof.." 4", + recipe = { + {"",reed}, + {reed,""}, + } + }) + minetest.register_craft({ -- slab -> roof + output = roof, + recipe = { + {slab}, + } + }) +----------------------------------------------------------------------------------------------- +-- Roof Corner +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- block -> corner + output = corner.." 8", + recipe = { + {"",reed,""}, + {reed,"",reed}, + } + }) + minetest.register_craft({ -- corner_2 -> corner + output = corner, + recipe = { + {corner_2}, + } + }) +----------------------------------------------------------------------------------------------- +-- Roof Corner 2 +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- block -> corner_2 + output = corner_2.." 8", + recipe = { + {reed,"",reed}, + {"",reed,""}, + } + }) + minetest.register_craft({ -- corner -> corner_2 + output = corner_2, + recipe = { + {corner}, + } + }) +end + +----------------------------------------------------------------------------------------------- +-- Reed +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- hay -> reed + output = "dryplants:reed 2", + recipe = { + {"dryplants:hay","dryplants:hay"}, + {"dryplants:hay","dryplants:hay"}, + } +}) +--cooking +minetest.register_craft({ -- wetreed -> reed + type = "cooking", + output = "dryplants:reed", + recipe = "dryplants:wetreed", + cooktime = 2, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed", + burntime = 4, +}) +----------------------------------------------------------------------------------------------- +-- Reed Slab +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ -- wetreed_slab -> reed_slab + type = "cooking", + output = "dryplants:reed_slab", + recipe = "dryplants:wetreed_slab", + cooktime = 1, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed_slab", + burntime = 2, +}) +----------------------------------------------------------------------------------------------- +-- Reed Roof +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ -- wetreed_roof -> reed_roof + type = "cooking", + output = "dryplants:reed_roof", + recipe = "dryplants:wetreed_roof", + cooktime = 1, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed_roof", + burntime = 2, +}) +----------------------------------------------------------------------------------------------- +-- Reed Roof Corner +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ -- wetreed_roof_corner -> reed_roof_corner + type = "cooking", + output = "dryplants:reed_roof_corner", + recipe = "dryplants:wetreed_roof_corner", + cooktime = 1, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed_roof_corner", + burntime = 2, +}) +----------------------------------------------------------------------------------------------- +-- Wet Reed Roof Corner 2 +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ -- wetreed_roof_corner -> reed_roof_corner + type = "cooking", + output = "dryplants:reed_roof_corner_2", + recipe = "dryplants:wetreed_roof_corner_2", + cooktime = 1, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed_roof_corner_2", + burntime = 2, +}) +----------------------------------------------------------------------------------------------- +-- Dandelion Leave +----------------------------------------------------------------------------------------------- +--[[minetest.register_craftitem("dryplants:dandelion_leave", { + description = "Dandelion Leave", + inventory_image = "dryplants_dandelion_leave.png", + on_use = minetest.item_eat(1), +}) +minetest.register_craft({ + type = "shapeless", + output = "dryplants:dandelion_leave 4", + recipe = {"flowers:dandelion_yellow"}, + replacements = { + {"flowers:dandelion_yellow", "dye:yellow"} + }, +})]] \ No newline at end of file diff --git a/dryplants/depends.txt b/dryplants/depends.txt new file mode 100644 index 0000000..465ad78 --- /dev/null +++ b/dryplants/depends.txt @@ -0,0 +1,3 @@ +default +farming +plants_lib \ No newline at end of file diff --git a/dryplants/init.lua b/dryplants/init.lua new file mode 100644 index 0000000..0227771 --- /dev/null +++ b/dryplants/init.lua @@ -0,0 +1,185 @@ +----------------------------------------------------------------------------------------------- +local title = "Grasses" -- former "Dry plants" +local version = "0.1.5" +local mname = "dryplants" +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- textures & ideas partly by Neuromancer + +-- License (everything): WTFPL +-- Contains code from: default, farming +-- Looked at code from: darkage, sickle, stairs +-- Dependencies: default, farming, plants_lib +-- Supports: +----------------------------------------------------------------------------------------------- +abstract_dryplants = {} + +dofile(minetest.get_modpath("dryplants").."/crafting.lua") +dofile(minetest.get_modpath("dryplants").."/settings.txt") +dofile(minetest.get_modpath("dryplants").."/reed.lua") +if REEDMACE_GENERATES == true then +dofile(minetest.get_modpath("dryplants").."/reedmace.lua") +end +if SMALL_JUNCUS_GENERATES == true then +dofile(minetest.get_modpath("dryplants").."/juncus.lua") +end +if EXTRA_TALL_GRASS_GENERATES == true then +dofile(minetest.get_modpath("dryplants").."/moregrass.lua") +end +--dofile(minetest.get_modpath("dryplants").."/meadowvariation.lua") + +----------------------------------------------------------------------------------------------- +-- Sickle +----------------------------------------------------------------------------------------------- +-- turns nodes with group flora=1 & flower=0 into cut grass +local function sickle_on_use(itemstack, user, pointed_thing, uses) + local pt = pointed_thing + -- check if pointing at a node + if not pt then + return + end + if pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} + local above = minetest.get_node(p) + + -- return if any of the nodes is not registered + if not minetest.registered_nodes[under.name] then + return + end + if not minetest.registered_nodes[above.name] then + return + end + + local node = minetest.env:get_node(pt.under) + -- check if something that can be cut using fine tools + if minetest.get_item_group(under.name, "snappy") > 0 then + -- check if flora but no flower + if minetest.get_item_group(under.name, "flora") == 1 and minetest.get_item_group(under.name, "flower") == 0 then + -- turn the node into cut grass, wear out item and play sound + minetest.set_node(pt.under, {name="dryplants:grass"}) + else -- otherwise get the drop + local inv = user:get_inventory() + local name = minetest.env: get_node(pt.under).name + + local the_drop = minetest.registered_nodes[name].drop + + if the_drop ~= nil then + if inv:room_for_item("main", the_drop) then + inv:add_item("main", the_drop) + end + else + if inv:room_for_item("main", name) then + inv:add_item("main", name) + end + end + minetest.env:remove_node(pt.under) + end + minetest.sound_play("default_dig_crumbly", { + pos = pt.under, + gain = 0.5, + }) + itemstack:add_wear(65535/(uses-1)) + return itemstack + elseif string.find(node.name, "default:dirt_with_grass") then + minetest.set_node(pt.under, {name="dryplants:grass_short"}) + minetest.set_node(pt.above, {name="dryplants:grass"}) + minetest.sound_play("default_dig_crumbly", { + pos = pt.under, + gain = 0.5, + }) + itemstack:add_wear(65535/(uses-1)) + return itemstack + end +end +-- the tool +minetest.register_tool("dryplants:sickle", { + description = "Sickle", + inventory_image = "dryplants_sickle.png", + on_use = function(itemstack, user, pointed_thing) + return sickle_on_use(itemstack, user, pointed_thing, 220) + end, +}) + +----------------------------------------------------------------------------------------------- +-- Cut Grass +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:grass", { + description = "Cut Grass", + inventory_image = "dryplants_grass.png", + wield_image = "dryplants_grass.png", + paramtype = "light", + sunlight_propagates = true, + tiles = {"dryplants_grass.png"}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {-0.5 , -0.5 , -0.5 , 0.5 , -0.4375, 0.5 }, + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Cut Grass becomes Hay over time +----------------------------------------------------------------------------------------------- +minetest.register_abm({ + nodenames = {"dryplants:grass"}, + interval = HAY_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle + chance = 1, + action = function(pos) + minetest.env:add_node(pos, {name="dryplants:hay"}) + end, +}) + +----------------------------------------------------------------------------------------------- +-- Hay +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:hay", { + description = "Hay", + inventory_image = "dryplants_hay.png", + wield_image = "dryplants_hay.png", + paramtype = "light", + sunlight_propagates = true, + tiles = {"dryplants_hay.png"}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {-0.5 , -0.5 , -0.5 , 0.5 , -0.4375, 0.5 }, + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Short Grass +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:grass_short", { + description = "Short Grass", + tiles = {"default_grass.png^dryplants_grass_short.png", "default_dirt.png", "default_dirt.png^default_grass_side.png^dryplants_grass_short_side.png"}, + is_ground_content = true, + groups = {crumbly=3,soil=1,not_in_creative_inventory=1}, + --drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +----------------------------------------------------------------------------------------------- +-- Short Grass becomes Dirt with Grass over time +----------------------------------------------------------------------------------------------- +minetest.register_abm({ + nodenames = {"dryplants:grass_short"}, + interval = GRASS_REGROWING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle + chance = 100/GRASS_REGROWING_CHANCE, + action = function(pos) + minetest.env:add_node(pos, {name="default:dirt_with_grass"}) + end, +}) + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/dryplants/juncus.lua b/dryplants/juncus.lua new file mode 100644 index 0000000..72934d2 --- /dev/null +++ b/dryplants/juncus.lua @@ -0,0 +1,127 @@ +----------------------------------------------------------------------------------------------- +-- Grasses - Juncus 0.0.5 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- textures & ideas partly by Neuromancer + +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default +----------------------------------------------------------------------------------------------- + +abstract_dryplants.grow_juncus = function(pos) + local juncus_type = math.random(2,3) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + if minetest.env:get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.env:get_node(right_here).name == "default:junglegrass" then + if juncus_type == 2 then + minetest.env:add_node(right_here, {name="dryplants:juncus_02"}) + else + minetest.env:add_node(right_here, {name="dryplants:juncus"}) + end + end +end + +minetest.register_node("dryplants:juncus", { + description = "Juncus", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_juncus_03.png"}, + inventory_image = "dryplants_juncus_inv.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + attached_node=1, + flora=1 + --not_in_creative_inventory=1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, + on_place = function(itemstack, placer, pointed_thing) + local pos = pointed_thing.under + local juncus_type = math.random(2,3) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + if juncus_type == 2 then + minetest.env:add_node(right_here, {name="dryplants:juncus_02"}) + else + minetest.env:add_node(right_here, {name="dryplants:juncus"}) + end + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end, +}) +minetest.register_node("dryplants:juncus_02", { + description = "Juncus", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_juncus_02.png"}, + walkable = false, + groups = { + snappy=3, + flammable=2, + attached_node=1, + flora=1, + not_in_creative_inventory=1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, + drop = "dryplants:juncus", +}) +----------------------------------------------------------------------------------------------- +-- GENERATE SMALL JUNCUS +----------------------------------------------------------------------------------------------- +-- near water or swamp +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + --"default:desert_sand", + --"default:sand", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = JUNCUS_NEAR_WATER_PER_MAPBLOCK, + rarity = 101 - JUNCUS_NEAR_WATER_RARITY, + min_elevation = 1, -- above sea level + near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_dryplants.grow_juncus" +) +-- at dunes/beach +plantslib:register_generate_plant({ + surface = { + --"default:dirt_with_grass", + --"default:desert_sand", + "default:sand", + --"stoneage:grass_with_silex", + --"sumpf:peat", + --"sumpf:sumpf" + }, + max_count = JUNCUS_AT_BEACH_PER_MAPBLOCK, + rarity = 101 - JUNCUS_AT_BEACH_RARITY, + min_elevation = 1, -- above sea level + near_nodes = {"default:dirt_with_grass"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_dryplants.grow_juncus" +) \ No newline at end of file diff --git a/dryplants/meadowvariation.lua b/dryplants/meadowvariation.lua new file mode 100644 index 0000000..2c3b554 --- /dev/null +++ b/dryplants/meadowvariation.lua @@ -0,0 +1,27 @@ +----------------------------------------------------------------------------------------------- +-- Grasses - Meadow Variation 0.0.1 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin + +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default +----------------------------------------------------------------------------------------------- + +abstract_dryplants.grow_grass_variation = function(pos) + local right_here = {x=pos.x, y=pos.y, z=pos.z} + minetest.add_node(right_here, {name="dryplants:grass_short"}) +end + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + }, + max_count = 4800, + rarity = 25, + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_dryplants.grow_grass_variation" +) \ No newline at end of file diff --git a/dryplants/moregrass.lua b/dryplants/moregrass.lua new file mode 100644 index 0000000..293a0d6 --- /dev/null +++ b/dryplants/moregrass.lua @@ -0,0 +1,35 @@ +----------------------------------------------------------------------------------------------- +-- Grasses - More Tall Grass 0.0.2 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin + +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default +----------------------------------------------------------------------------------------------- + +abstract_dryplants.grow_grass = function(pos) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + local grass_size = math.random(1,5) + if minetest.get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.get_node(right_here).name == "default:junglegrass" then + minetest.add_node(right_here, {name="default:grass_"..grass_size}) + end +end + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "dryplants:grass_short", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = TALL_GRASS_PER_MAPBLOCK, + rarity = 101 - TALL_GRASS_RARITY, + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_dryplants.grow_grass" +) \ No newline at end of file diff --git a/dryplants/reed.lua b/dryplants/reed.lua new file mode 100644 index 0000000..f4e97a8 --- /dev/null +++ b/dryplants/reed.lua @@ -0,0 +1,380 @@ +----------------------------------------------------------------------------------------------- +-- Dry Plants - Reed 0.0.5 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Looked at code from: darkage, default, stairs +-- Dependencies: default +----------------------------------------------------------------------------------------------- +minetest.register_alias("stairs:stair_wetreed", "dryplants:wetreed_roof") +minetest.register_alias("stairs:slab_wetreed", "dryplants:wetreed_slab") +minetest.register_alias("stairs:stair_reed", "dryplants:reed_roof") +minetest.register_alias("stairs:slab_reed", "dryplants:reed_slab") + + +----------------------------------------------------------------------------------------------- +-- Wet Reed +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed", { + description = "Wet Reed", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.png"}, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed Slab +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed_slab", { + description = "Wet Reed Slab", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.png"}, + node_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2}, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2}, + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed Roof +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed_roof", { + description = "Wet Reed Roof", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.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}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1/2, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, -1/2, -1/2, 1/2, 0, 0}, + } + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +if AUTO_ROOF_CORNER == true then + + local CoRNeR = { +-- MaTeRiaL + {"wetreed"}, + {"reed"} + } + + for i in pairs(CoRNeR) do + + local MaTeRiaL = CoRNeR[i][1] + local roof = "dryplants:"..MaTeRiaL.."_roof" + local corner = "dryplants:"..MaTeRiaL.."_roof_corner" + local corner_2 = "dryplants:"..MaTeRiaL.."_roof_corner_2" + + minetest.register_abm({ + nodenames = {roof}, + interval = 1, + chance = 1, + action = function(pos) + + local node_east = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z }) + local node_west = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z }) + local node_north = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local node_south = minetest.env: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.env:add_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.env:add_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.env:add_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.env:add_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.env:add_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.env:add_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.env:add_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.env:add_node(pos, {name=corner_2, param2=3}) + end + + end, + }) + end +end + +----------------------------------------------------------------------------------------------- +-- Wet Reed Roof Corner +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed_roof_corner", { + description = "Wet Reed Roof Corner", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.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}, + } + }, + selection_box = { + type = "fixed", + 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 = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed Roof Corner 2 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed_roof_corner_2", { + description = "Wet Reed Roof Corner 2", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.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}, + } + }, + selection_box = { + type = "fixed", + 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 = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed becomes (dry) Reed over time +----------------------------------------------------------------------------------------------- +if REED_WILL_DRY == true then + + local DRyiNG = { +-- WeT DRy + {"dryplants:wetreed", "dryplants:reed"}, + {"dryplants:wetreed_slab", "dryplants:reed_slab"}, + {"dryplants:wetreed_roof", "dryplants:reed_roof"}, + {"dryplants:wetreed_roof_corner", "dryplants:reed_roof_corner"}, + {"dryplants:wetreed_roof_corner_2", "dryplants:reed_roof_corner_2"} + } + for i in pairs(DRyiNG) do + + local WeT = DRyiNG[i][1] + local DRy = DRyiNG[i][2] + + minetest.register_abm({ + nodenames = {WeT}, + interval = REED_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle + chance = 1, + action = function(pos) + local direction = minetest.get_node(pos).param2 + minetest.env:add_node(pos, {name=DRy, param2=direction}) + end, + }) + end +end + +----------------------------------------------------------------------------------------------- +-- Reed +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed", { + description = "Reed", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.png"}, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Reed Slab +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed_slab", { + description = "Reed Slab", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.png"}, + node_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2}, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2}, + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Reed Roof +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed_roof", { + description = "Reed Roof", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.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}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1/2, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, -1/2, -1/2, 1/2, 0, 0}, + } + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Reed Roof Corner +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed_roof_corner", { + description = "Reed Roof Corner", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.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}, + } + }, + selection_box = { + type = "fixed", + 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 = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Reed Roof Corner 2 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed_roof_corner_2", { + description = "Reed Roof Corner 2", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.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}, + } + }, + selection_box = { + type = "fixed", + 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 = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) \ No newline at end of file diff --git a/dryplants/reedmace.lua b/dryplants/reedmace.lua new file mode 100644 index 0000000..88d9f76 --- /dev/null +++ b/dryplants/reedmace.lua @@ -0,0 +1,410 @@ +----------------------------------------------------------------------------------------------- +-- Grasses - Reedmace 0.1.1 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- textures & ideas partly by Neuromancer + +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default, trees +----------------------------------------------------------------------------------------------- + +-- NOTES (from wikipedia, some of this might get implemented) +-- rhizomes are edible +-- outer portion of young plants can be peeled and the heart can be eaten raw or boiled and eaten like asparagus +-- leaf bases can be eaten raw or cooked +-- sheath can be removed from the developing green flower spike, which can then be boiled and eaten like corn on the cob +-- pollen can be collected and used as a flour supplement or thickener +-- Typha stems and leaves can be used to make paper +-- The seed hairs were used by some Native American groups as tinder for starting fires + +----------------------------------------------------------------------------------------------- +-- REEDMACE SHAPES +----------------------------------------------------------------------------------------------- + +abstract_dryplants.grow_reedmace = function(pos) + local size = math.random(1,3) + local spikes = math.random(1,3) + local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} + local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z} + local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z} + if minetest.env:get_node(pos_01).name == "air" -- bug fix + or minetest.env:get_node(pos_01).name == "dryplants:reedmace_sapling" then + if minetest.env:get_node(pos_02).name ~= "air" then + minetest.env:add_node(pos_01, {name="dryplants:reedmace_top"}) + elseif minetest.env:get_node(pos_03).name ~= "air" then + minetest.env:add_node(pos_01, {name="dryplants:reedmace_height_2"}) + elseif size == 1 then + minetest.env:add_node(pos_01, {name="dryplants:reedmace_top"}) + elseif size == 2 then + minetest.env:add_node(pos_01, {name="dryplants:reedmace_height_2"}) + elseif size == 3 then + if spikes == 1 then + minetest.env:add_node(pos_01, {name="dryplants:reedmace_height_3_spikes"}) + else + minetest.env:add_node(pos_01, {name="dryplants:reedmace_height_3"}) + end + end + end +end + +abstract_dryplants.grow_reedmace_water = function(pos) + local size = math.random(1,3) + local spikes = math.random(1,3) + local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} + local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z} + local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z} + local pos_04 = {x = pos.x, y = pos.y + 4, z = pos.z} + minetest.add_entity(pos_01, "dryplants:reedmace_water_entity") + if minetest.env:get_node(pos_02).name == "air" then -- bug fix + if minetest.env:get_node(pos_03).name ~= "air" then + minetest.env:add_node(pos_02, {name="dryplants:reedmace_top"}) + elseif minetest.env:get_node(pos_04).name ~= "air" then + minetest.env:add_node(pos_02, {name="dryplants:reedmace_height_2"}) + elseif size == 1 then + minetest.env:add_node(pos_02, {name="dryplants:reedmace_top"}) + elseif size == 2 then + minetest.env:add_node(pos_02, {name="dryplants:reedmace_height_2"}) + elseif size == 3 then + if spikes == 1 then + minetest.env:add_node(pos_02, {name="dryplants:reedmace_height_3_spikes"}) + else + minetest.env:add_node(pos_02, {name="dryplants:reedmace_height_3"}) + end + end + end +end + +----------------------------------------------------------------------------------------------- +-- REEDMACE SPIKES +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_spikes", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_spikes.png"}, + inventory_image = "dryplants_reedmace_spikes.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE height: 1 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_top", { + description = "Reedmace, height: 1", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_top.png"}, + inventory_image = "dryplants_reedmace_top.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE height: 2 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_height_2", { + description = "Reedmace, height: 2", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_reedmace_height_2.png"}, + inventory_image = "dryplants_reedmace_top.png", + walkable = false, + groups = { + snappy=3, + flammable=2--, + --not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE height: 3 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_height_3", { + description = "Reedmace, height: 3", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_reedmace_height_3.png"}, + inventory_image = "dryplants_reedmace_top.png", + walkable = false, + groups = { + snappy=3, + flammable=2--, + --not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE height: 3 & Spikes +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_height_3_spikes", { + description = "Reedmace, height: 3 & Spikes", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_reedmace_height_3_spikes.png"}, + inventory_image = "dryplants_reedmace_top.png", + walkable = false, + groups = { + snappy=3, + flammable=2--, + --not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE STEMS +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace.png"}, + inventory_image = "dryplants_reedmace.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + after_destruct = function(pos,oldnode) + local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if node.name == "dryplants:reedmace_top" + or node.name == "dryplants:reedmace_spikes" then + minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) + minetest.add_item(pos,"dryplants:reedmace_sapling") + end + end, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE BOTTOM +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_bottom", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_bottom.png"}, + inventory_image = "dryplants_reedmace_bottom.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + after_destruct = function(pos,oldnode) + local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if node.name == "dryplants:reedmace" + or node.name == "dryplants:reedmace_top" + or node.name == "dryplants:reedmace_spikes" then + minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) + minetest.add_item(pos,"dryplants:reedmace_sapling") + end + end, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE "SAPLING" (the drop from the above) +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_sapling", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_sapling.png"}, + inventory_image = "dryplants_reedmace_sapling.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + attached_node=1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +-- abm +minetest.register_abm({ + nodenames = "dryplants:reedmace_sapling", + interval = REEDMACE_GROWING_TIME, + chance = 100/REEDMACE_GROWING_CHANCE, + action = function(pos, node, _, _) + if string.find(minetest.env:get_node({x = pos.x + 1, y = pos.y, z = pos.z }).name, "default:water") + or string.find(minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z + 1}).name, "default:water") + or string.find(minetest.env:get_node({x = pos.x - 1, y = pos.y, z = pos.z }).name, "default:water") + or string.find(minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z - 1}).name, "default:water") then + if minetest.env:get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then + abstract_dryplants.grow_reedmace_water({x = pos.x, y = pos.y - 1, z = pos.z}) + end + minetest.env:add_node({x=pos.x, y=pos.y, z=pos.z}, {name="default:water_source"}) + else + abstract_dryplants.grow_reedmace({x = pos.x, y = pos.y - 1, z = pos.z}) + end + end +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE WATER (for entity) +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_water", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_water.png"}, + inventory_image = "dryplants_reedmace_water.png", + groups = {not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE WATER ENTITY +----------------------------------------------------------------------------------------------- +minetest.register_entity("dryplants:reedmace_water_entity",{ + visual = "wielditem", + visual_size = {x=2/3, y=2/3, z=2/3}, + textures = {"dryplants:reedmace_water"}, + collisionbox = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + on_punch = function(self, puncher) + if puncher:is_player() and puncher:get_inventory() then + if not minetest.setting_getbool("creative_mode") then + puncher:get_inventory():add_item("main", "dryplants:reedmace_sapling") + end + self.object:remove() + end + end, +}) +----------------------------------------------------------------------------------------------- +-- SPAWN REEDMACE +----------------------------------------------------------------------------------------------- +--[[plantslib:spawn_on_surfaces({ + spawn_delay = 1200, + spawn_plants = {"dryplants:reedmace_sapling"}, + spawn_chance = 400, + spawn_surfaces = { + "default:dirt_with_grass", + "default:desert_sand", + "default:sand", + "dryplants:grass_short", + "stoneage:grass_with_silex" + }, + seed_diff = 329, + near_nodes = {"default:water_source"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, +})]] +----------------------------------------------------------------------------------------------- +-- GENERATE REEDMACE +----------------------------------------------------------------------------------------------- +-- near water or swamp +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "default:desert_sand", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = REEDMACE_NEAR_WATER_PER_MAPBLOCK, + rarity = 101 - REEDMACE_NEAR_WATER_RARITY, + --rarity = 60, + min_elevation = 1, -- above sea level + near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + "abstract_dryplants.grow_reedmace" +) +-- in water +plantslib:register_generate_plant({ + surface = { + "default:dirt", + "default:dirt_with_grass", + --"default:desert_sand", + --"stoneage:grass_with_silex", + "stoneage:sand_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = REEDMACE_IN_WATER_PER_MAPBLOCK, + rarity = 101 - REEDMACE_IN_WATER_RARITY, + --rarity = 35, + min_elevation = 0, -- a bit below sea level + max_elevation = 0, -- "" + near_nodes = {"default:water_source","sumpf:dirtywater_source"}, + near_nodes_size = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + "abstract_dryplants.grow_reedmace_water" +) +-- for oases & tropical beaches & tropical swamps +plantslib:register_generate_plant({ + surface = { + "default:sand", + "sumpf:sumpf" + }, + max_count = REEDMACE_FOR_OASES_PER_MAPBLOCK, + rarity = 101 - REEDMACE_FOR_OASES_RARITY, + --rarity = 10, + neighbors = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"}, + ncount = 1, + min_elevation = 1, -- above sea level + near_nodes = {"default:desert_sand","sumpf:sumpf"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + "abstract_dryplants.grow_reedmace" +) diff --git a/dryplants/settings.txt b/dryplants/settings.txt new file mode 100644 index 0000000..a9c6369 --- /dev/null +++ b/dryplants/settings.txt @@ -0,0 +1,52 @@ +-- Here you can enable/disable the different plants +REEDMACE_GENERATES = true +SMALL_JUNCUS_GENERATES = true +EXTRA_TALL_GRASS_GENERATES = true + + + +-- Amount of Reedmace near water or swamp +REEDMACE_NEAR_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number) +REEDMACE_NEAR_WATER_RARITY = 40 -- percent + +-- Amount of Reedmace in water +REEDMACE_IN_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number) +REEDMACE_IN_WATER_RARITY = 65 -- percent + +-- Amount of Reedmace for oases, tropical beaches and tropical swamps +REEDMACE_FOR_OASES_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number) +REEDMACE_FOR_OASES_RARITY = 90 -- percent + +-- growing of reedmace sapling +REEDMACE_GROWING_TIME = 16800 -- seconds +REEDMACE_GROWING_CHANCE = 5 -- percent + + + +-- Amount of small Juncus near water or swamp +JUNCUS_NEAR_WATER_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number) +JUNCUS_NEAR_WATER_RARITY = 75 -- percent + +-- Amount of small Juncus at dunes/beach +JUNCUS_AT_BEACH_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number) +JUNCUS_AT_BEACH_RARITY = 75 -- percent + + + +-- Tall Grass on dirt with grass +TALL_GRASS_PER_MAPBLOCK = 4800 -- plants per 80x80x80 nodes (absolute maximum number) +TALL_GRASS_RARITY = 75 -- percent + + + +-- short grass becomes dirt with grass again +GRASS_REGROWING_TIME = 16800 -- seconds +GRASS_REGROWING_CHANCE = 0.5 -- percent + +HAY_DRYING_TIME = 3600 -- seconds + +REED_WILL_DRY = false -- wet reed nodes will become dry reed nodes +REED_DRYING_TIME = 3600 -- seconds + +AUTO_ROOF_CORNER = true + diff --git a/dryplants/textures/default_grass_1.png b/dryplants/textures/default_grass_1.png new file mode 100644 index 0000000..594a23b Binary files /dev/null and b/dryplants/textures/default_grass_1.png differ diff --git a/dryplants/textures/default_grass_2.png b/dryplants/textures/default_grass_2.png new file mode 100644 index 0000000..7f1025a Binary files /dev/null and b/dryplants/textures/default_grass_2.png differ diff --git a/dryplants/textures/default_grass_3.png b/dryplants/textures/default_grass_3.png new file mode 100644 index 0000000..aec589f Binary files /dev/null and b/dryplants/textures/default_grass_3.png differ diff --git a/dryplants/textures/default_grass_4.png b/dryplants/textures/default_grass_4.png new file mode 100644 index 0000000..e9c8c88 Binary files /dev/null and b/dryplants/textures/default_grass_4.png differ diff --git a/dryplants/textures/default_grass_5.png b/dryplants/textures/default_grass_5.png new file mode 100644 index 0000000..20dcd2b Binary files /dev/null and b/dryplants/textures/default_grass_5.png differ diff --git a/dryplants/textures/dryplants_grass.png b/dryplants/textures/dryplants_grass.png new file mode 100644 index 0000000..a01ec98 Binary files /dev/null and b/dryplants/textures/dryplants_grass.png differ diff --git a/dryplants/textures/dryplants_grass_short.png b/dryplants/textures/dryplants_grass_short.png new file mode 100644 index 0000000..ad186e5 Binary files /dev/null and b/dryplants/textures/dryplants_grass_short.png differ diff --git a/dryplants/textures/dryplants_grass_short_side.png b/dryplants/textures/dryplants_grass_short_side.png new file mode 100644 index 0000000..a6429ac Binary files /dev/null and b/dryplants/textures/dryplants_grass_short_side.png differ diff --git a/dryplants/textures/dryplants_hay.png b/dryplants/textures/dryplants_hay.png new file mode 100644 index 0000000..a919166 Binary files /dev/null and b/dryplants/textures/dryplants_hay.png differ diff --git a/dryplants/textures/dryplants_juncus_02.png b/dryplants/textures/dryplants_juncus_02.png new file mode 100644 index 0000000..aebaace Binary files /dev/null and b/dryplants/textures/dryplants_juncus_02.png differ diff --git a/dryplants/textures/dryplants_juncus_03.png b/dryplants/textures/dryplants_juncus_03.png new file mode 100644 index 0000000..4d67593 Binary files /dev/null and b/dryplants/textures/dryplants_juncus_03.png differ diff --git a/dryplants/textures/dryplants_juncus_inv.png b/dryplants/textures/dryplants_juncus_inv.png new file mode 100644 index 0000000..4fad2f2 Binary files /dev/null and b/dryplants/textures/dryplants_juncus_inv.png differ diff --git a/dryplants/textures/dryplants_reed.png b/dryplants/textures/dryplants_reed.png new file mode 100644 index 0000000..565876b Binary files /dev/null and b/dryplants/textures/dryplants_reed.png differ diff --git a/dryplants/textures/dryplants_reed_wet.png b/dryplants/textures/dryplants_reed_wet.png new file mode 100644 index 0000000..106f069 Binary files /dev/null and b/dryplants/textures/dryplants_reed_wet.png differ diff --git a/dryplants/textures/dryplants_reedmace.png b/dryplants/textures/dryplants_reedmace.png new file mode 100644 index 0000000..ee7840f Binary files /dev/null and b/dryplants/textures/dryplants_reedmace.png differ diff --git a/dryplants/textures/dryplants_reedmace_bottom.png b/dryplants/textures/dryplants_reedmace_bottom.png new file mode 100644 index 0000000..4e441f4 Binary files /dev/null and b/dryplants/textures/dryplants_reedmace_bottom.png differ diff --git a/dryplants/textures/dryplants_reedmace_height_2.png b/dryplants/textures/dryplants_reedmace_height_2.png new file mode 100644 index 0000000..fc09781 Binary files /dev/null and b/dryplants/textures/dryplants_reedmace_height_2.png differ diff --git a/dryplants/textures/dryplants_reedmace_height_3.png b/dryplants/textures/dryplants_reedmace_height_3.png new file mode 100644 index 0000000..89c495c Binary files /dev/null and b/dryplants/textures/dryplants_reedmace_height_3.png differ diff --git a/dryplants/textures/dryplants_reedmace_height_3_spikes.png b/dryplants/textures/dryplants_reedmace_height_3_spikes.png new file mode 100644 index 0000000..a9f2152 Binary files /dev/null and b/dryplants/textures/dryplants_reedmace_height_3_spikes.png differ diff --git a/dryplants/textures/dryplants_reedmace_sapling.png b/dryplants/textures/dryplants_reedmace_sapling.png new file mode 100644 index 0000000..dc03696 Binary files /dev/null and b/dryplants/textures/dryplants_reedmace_sapling.png differ diff --git a/dryplants/textures/dryplants_reedmace_spikes.png b/dryplants/textures/dryplants_reedmace_spikes.png new file mode 100644 index 0000000..efab468 Binary files /dev/null and b/dryplants/textures/dryplants_reedmace_spikes.png differ diff --git a/dryplants/textures/dryplants_reedmace_top.png b/dryplants/textures/dryplants_reedmace_top.png new file mode 100644 index 0000000..6beb585 Binary files /dev/null and b/dryplants/textures/dryplants_reedmace_top.png differ diff --git a/dryplants/textures/dryplants_reedmace_water.png b/dryplants/textures/dryplants_reedmace_water.png new file mode 100644 index 0000000..0b2b06d Binary files /dev/null and b/dryplants/textures/dryplants_reedmace_water.png differ diff --git a/dryplants/textures/dryplants_sickle.png b/dryplants/textures/dryplants_sickle.png new file mode 100644 index 0000000..31d21de Binary files /dev/null and b/dryplants/textures/dryplants_sickle.png differ diff --git a/dryplants/textures/not_in_use/big_pic_8.png b/dryplants/textures/not_in_use/big_pic_8.png new file mode 100644 index 0000000..c39a013 Binary files /dev/null and b/dryplants/textures/not_in_use/big_pic_8.png differ diff --git a/dryplants/textures/not_in_use/big_pic_9.png b/dryplants/textures/not_in_use/big_pic_9.png new file mode 100644 index 0000000..2779783 Binary files /dev/null and b/dryplants/textures/not_in_use/big_pic_9.png differ diff --git a/dryplants/textures/not_in_use/dryplants_cattailsG_m2.png b/dryplants/textures/not_in_use/dryplants_cattailsG_m2.png new file mode 100644 index 0000000..5af4689 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_cattailsG_m2.png differ diff --git a/dryplants/textures/not_in_use/dryplants_juncus_02_left.png b/dryplants/textures/not_in_use/dryplants_juncus_02_left.png new file mode 100644 index 0000000..8b23c7a Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_juncus_02_left.png differ diff --git a/dryplants/textures/not_in_use/dryplants_juncus_02_right.png b/dryplants/textures/not_in_use/dryplants_juncus_02_right.png new file mode 100644 index 0000000..0ffa002 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_juncus_02_right.png differ diff --git a/dryplants/textures/not_in_use/dryplants_juncus_02_whole2.png b/dryplants/textures/not_in_use/dryplants_juncus_02_whole2.png new file mode 100644 index 0000000..7708b49 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_juncus_02_whole2.png differ diff --git a/dryplants/textures/not_in_use/dryplants_juncus_03_left.png b/dryplants/textures/not_in_use/dryplants_juncus_03_left.png new file mode 100644 index 0000000..9df8724 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_juncus_03_left.png differ diff --git a/dryplants/textures/not_in_use/dryplants_juncus_03_right.png b/dryplants/textures/not_in_use/dryplants_juncus_03_right.png new file mode 100644 index 0000000..d43af2e Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_juncus_03_right.png differ diff --git a/dryplants/textures/not_in_use/dryplants_juncus_03_whole2.png b/dryplants/textures/not_in_use/dryplants_juncus_03_whole2.png new file mode 100644 index 0000000..e7af090 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_juncus_03_whole2.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_01.png b/dryplants/textures/not_in_use/dryplants_reedmace_01.png new file mode 100644 index 0000000..c2b1546 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_01.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_02.png b/dryplants/textures/not_in_use/dryplants_reedmace_02.png new file mode 100644 index 0000000..8380c20 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_02.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_03.png b/dryplants/textures/not_in_use/dryplants_reedmace_03.png new file mode 100644 index 0000000..0ee837d Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_03.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_04.png b/dryplants/textures/not_in_use/dryplants_reedmace_04.png new file mode 100644 index 0000000..800cb96 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_04.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_bottom_left.png b/dryplants/textures/not_in_use/dryplants_reedmace_bottom_left.png new file mode 100644 index 0000000..c28ba71 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_bottom_left.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_bottom_right.png b/dryplants/textures/not_in_use/dryplants_reedmace_bottom_right.png new file mode 100644 index 0000000..65b544a Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_bottom_right.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_left.png b/dryplants/textures/not_in_use/dryplants_reedmace_left.png new file mode 100644 index 0000000..69783a8 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_left.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_right.png b/dryplants/textures/not_in_use/dryplants_reedmace_right.png new file mode 100644 index 0000000..30b77ac Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_right.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_top_left.png b/dryplants/textures/not_in_use/dryplants_reedmace_top_left.png new file mode 100644 index 0000000..78395b8 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_top_left.png differ diff --git a/dryplants/textures/not_in_use/dryplants_reedmace_top_right.png b/dryplants/textures/not_in_use/dryplants_reedmace_top_right.png new file mode 100644 index 0000000..d64b537 Binary files /dev/null and b/dryplants/textures/not_in_use/dryplants_reedmace_top_right.png differ diff --git a/dryplants/textures/not_in_use/reedmace2.png b/dryplants/textures/not_in_use/reedmace2.png new file mode 100644 index 0000000..2450cea Binary files /dev/null and b/dryplants/textures/not_in_use/reedmace2.png differ diff --git a/dryplants/textures/not_in_use/reedmace3.png b/dryplants/textures/not_in_use/reedmace3.png new file mode 100644 index 0000000..395a110 Binary files /dev/null and b/dryplants/textures/not_in_use/reedmace3.png differ diff --git a/dryplants/textures/not_in_use/reedmace4.png b/dryplants/textures/not_in_use/reedmace4.png new file mode 100644 index 0000000..02624ff Binary files /dev/null and b/dryplants/textures/not_in_use/reedmace4.png differ diff --git a/dryplants/textures/not_in_use/reedtest.png b/dryplants/textures/not_in_use/reedtest.png new file mode 100644 index 0000000..34a7a05 Binary files /dev/null and b/dryplants/textures/not_in_use/reedtest.png differ diff --git a/dryplants/textures/not_in_use/texturing.png b/dryplants/textures/not_in_use/texturing.png new file mode 100644 index 0000000..8526434 Binary files /dev/null and b/dryplants/textures/not_in_use/texturing.png differ diff --git a/dryplants/textures/old/dryplants_grass_short_old3.png b/dryplants/textures/old/dryplants_grass_short_old3.png new file mode 100644 index 0000000..f6f6c5b Binary files /dev/null and b/dryplants/textures/old/dryplants_grass_short_old3.png differ diff --git a/dryplants/textures/old/dryplants_grass_short_old4.png b/dryplants/textures/old/dryplants_grass_short_old4.png new file mode 100644 index 0000000..571019a Binary files /dev/null and b/dryplants/textures/old/dryplants_grass_short_old4.png differ diff --git a/dryplants/textures/old/dryplants_juncus_02_left_old.png b/dryplants/textures/old/dryplants_juncus_02_left_old.png new file mode 100644 index 0000000..4fb9f25 Binary files /dev/null and b/dryplants/textures/old/dryplants_juncus_02_left_old.png differ diff --git a/dryplants/textures/old/dryplants_juncus_02_right_old.png b/dryplants/textures/old/dryplants_juncus_02_right_old.png new file mode 100644 index 0000000..2e9af80 Binary files /dev/null and b/dryplants/textures/old/dryplants_juncus_02_right_old.png differ diff --git a/dryplants/textures/old/dryplants_juncus_03_left_old.png b/dryplants/textures/old/dryplants_juncus_03_left_old.png new file mode 100644 index 0000000..055a9c0 Binary files /dev/null and b/dryplants/textures/old/dryplants_juncus_03_left_old.png differ diff --git a/dryplants/textures/old/dryplants_juncus_03_right_old.png b/dryplants/textures/old/dryplants_juncus_03_right_old.png new file mode 100644 index 0000000..702abce Binary files /dev/null and b/dryplants/textures/old/dryplants_juncus_03_right_old.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_bottom_left_old2.png b/dryplants/textures/old/dryplants_reedmace_bottom_left_old2.png new file mode 100644 index 0000000..5ccbb7d Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_bottom_left_old2.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_bottom_old4.png b/dryplants/textures/old/dryplants_reedmace_bottom_old4.png new file mode 100644 index 0000000..8a39dce Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_bottom_old4.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_bottom_right_old2.png b/dryplants/textures/old/dryplants_reedmace_bottom_right_old2.png new file mode 100644 index 0000000..d82ce5a Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_bottom_right_old2.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_left_old2.png b/dryplants/textures/old/dryplants_reedmace_left_old2.png new file mode 100644 index 0000000..a66f882 Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_left_old2.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_old8.png b/dryplants/textures/old/dryplants_reedmace_old8.png new file mode 100644 index 0000000..404cac0 Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_old8.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_right_old2.png b/dryplants/textures/old/dryplants_reedmace_right_old2.png new file mode 100644 index 0000000..c916975 Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_right_old2.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_spikes_old3.png b/dryplants/textures/old/dryplants_reedmace_spikes_old3.png new file mode 100644 index 0000000..5cb09e1 Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_spikes_old3.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_top_left_old2.png b/dryplants/textures/old/dryplants_reedmace_top_left_old2.png new file mode 100644 index 0000000..138786a Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_top_left_old2.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_top_old3.png b/dryplants/textures/old/dryplants_reedmace_top_old3.png new file mode 100644 index 0000000..07f9539 Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_top_old3.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_top_right_old2.png b/dryplants/textures/old/dryplants_reedmace_top_right_old2.png new file mode 100644 index 0000000..06c8888 Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_top_right_old2.png differ diff --git a/dryplants/textures/old/dryplants_reedmace_water_old2.png b/dryplants/textures/old/dryplants_reedmace_water_old2.png new file mode 100644 index 0000000..cfb4705 Binary files /dev/null and b/dryplants/textures/old/dryplants_reedmace_water_old2.png differ diff --git a/ferns/SeTTiNGS.txt b/ferns/SeTTiNGS.txt new file mode 100644 index 0000000..6a82e4f --- /dev/null +++ b/ferns/SeTTiNGS.txt @@ -0,0 +1,42 @@ +-- In case you don't wanna have errors: + +-- Only change what's behind a "=" (or "--"). +-- Don't use caps (behind a "="). + +-- If there's a "false" (behind a "=") you can change it to "true" (and the other way around). +-- Spelling is important. +-- If "true" or "false" is necessary as setting, everything(!) which is not spelled "true" will be read as if it were "false" (even "1", "True"...) + +-- If you wanna comment something (for example to remember the default value), you can do this by putting "--" in front of the comment. +-- You can put "--" at the end of a line with "=" in it, or at the beginning of an empty/new line (minetest will ignore what's behind it then). +-- But don't put "--" in front of a line with "=" in it (or else minetest will ignore the setting and you might get an error). + +-- If something is still unclear, don't hesitate to post your question @ https://forum.minetest.net/viewtopic.php?id=6921 + + +-- Which plants should generate/spawn? +Lady_fern = true +Horsetails = true +Tree_Fern = true +Giant_Tree_Fern = true + +-- Where should they generate/spawn? (if they generate/spawn) +-- +-- Lady-Fern +Ferns_near_Tree = true +Ferns_near_Rock = true +Ferns_near_Ores = true -- if there's a bunch of ferns there's ores nearby, this one causes a huge fps drop +Ferns_in_Groups = false -- this one is meant as a replacement of Ferns_near_Ores: ferns tend to generate in groups, less fps drop, no hint for nearby ores +-- +-- Horsetails +Horsetails_Spawning = true -- horsetails will grow in already explored areas, over time, near water or gravel +Horsetails_on_Grass = true -- on dirt with grass and swamp (sumpf mod) +Horsetails_on_Stony = true -- on gravel, mossy cobble and silex (stoneage mod) +-- +-- Tree_Fern +Tree_Ferns_in_Jungle = true +Tree_Ferns_for_Oases = true -- for oases and tropical beaches +-- +-- Giant_Tree_Fern +Giant_Tree_Ferns_in_Jungle = true +Giant_Tree_Ferns_for_Oases = true -- for oases and tropical beaches diff --git a/ferns/crafting.lua b/ferns/crafting.lua new file mode 100644 index 0000000..8d8b3ed --- /dev/null +++ b/ferns/crafting.lua @@ -0,0 +1,104 @@ +----------------------------------------------------------------------------------------------- +-- Ferns - Crafting 0.0.5 +----------------------------------------------------------------------------------------------- +-- (by Mossmanikin) +-- License (everything): WTFPL +----------------------------------------------------------------------------------------------- +minetest.register_craft({ + type = "shapeless", + output = "ferns:fiddlehead 3", + recipe = {"ferns:fern_01"}, + replacements = { + {"ferns:fern_01", "ferns:ferntuber"} + }, +}) + +minetest.register_craft({ + type = "shapeless", + output = "ferns:fiddlehead 3", + recipe = {"ferns:tree_fern_leaves"}, + replacements = { + {"ferns:tree_fern_leaves", "ferns:sapling_tree_fern"} + }, +}) +----------------------------------------------------------------------------------------------- +-- FIDDLEHEAD +----------------------------------------------------------------------------------------------- +minetest.register_alias("archaeplantae:fiddlehead", "ferns:fiddlehead") + +minetest.register_craftitem("ferns:fiddlehead", { + description = "Fiddlehead", + inventory_image = "ferns_fiddlehead.png", + on_use = minetest.item_eat(-1), -- slightly poisonous when raw +}) +minetest.register_craft({ + type = "cooking", + output = "ferns:fiddlehead_roasted", + recipe = "ferns:fiddlehead", + cooktime = 1, +}) +minetest.register_craftitem("ferns:fiddlehead_roasted", { + description = "Roasted Fiddlehead", + inventory_image = "ferns_fiddlehead_roasted.png", + on_use = minetest.item_eat(1), -- edible when cooked +}) +----------------------------------------------------------------------------------------------- +-- FERN TUBER +----------------------------------------------------------------------------------------------- +minetest.register_alias("archaeplantae:ferntuber", "ferns:ferntuber") + +minetest.register_craftitem("ferns:ferntuber", { + description = "Fern Tuber", + inventory_image = "ferns_ferntuber.png", +}) +minetest.register_craft({ + type = "cooking", + output = "ferns:ferntuber_roasted", + recipe = "ferns:ferntuber", + cooktime = 3, +}) + +minetest.register_alias("archaeplantae:ferntuber_roasted", "ferns:ferntuber_roasted") + +minetest.register_craftitem("ferns:ferntuber_roasted", { + description = "Roasted Fern Tuber", + inventory_image = "ferns_ferntuber_roasted.png", + on_use = minetest.item_eat(3), +}) +----------------------------------------------------------------------------------------------- +-- HORSETAIL (EQUISETUM) --> GREEN DYE https://en.wikipedia.org/wiki/Equisetum +----------------------------------------------------------------------------------------------- +minetest.register_craft({ + type = "shapeless", + output = "dye:green", + recipe = {"group:horsetail"}, +}) +----------------------------------------------------------------------------------------------- +-- GLUE WOODEN TOOLS with RESIN & POLISH them with HORSETAIL (planned) +----------------------------------------------------------------------------------------------- +--[[minetest.register_craft({ + type = "shapeless", + output = "default:pick_wood", + recipe = {"default:pick_wood","group:horsetail","farming:string","default:stick"}, +}) +minetest.register_craft({ + type = "shapeless", + output = "default:shovel_wood", + recipe = {"default:shovel_wood","group:horsetail","farming:string","default:stick"}, +}) +minetest.register_craft({ + type = "shapeless", + output = "default:axe_wood", + recipe = {"default:axe_wood","group:horsetail","farming:string","default:stick"}, +}) +minetest.register_craft({ + type = "shapeless", + output = "default:sword_wood", + recipe = {"default:sword_wood","group:horsetail","farming:string","default:stick"}, +}) +minetest.register_craft({ + type = "shapeless", + output = "farming:hoe_wood", + recipe = {"farming:hoe_wood","group:horsetail","farming:string","default:stick"}, +})]] + diff --git a/ferns/depends.txt b/ferns/depends.txt new file mode 100644 index 0000000..0077f8a --- /dev/null +++ b/ferns/depends.txt @@ -0,0 +1,2 @@ +default +plants_lib \ No newline at end of file diff --git a/ferns/fern.lua b/ferns/fern.lua new file mode 100644 index 0000000..01b807d --- /dev/null +++ b/ferns/fern.lua @@ -0,0 +1,250 @@ +----------------------------------------------------------------------------------------------- +-- Ferns - Fern 0.1.0 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default, flowers, painting, trees +-- Dependencies: plants_lib +-- Supports: dryplants, stoneage, sumpf +----------------------------------------------------------------------------------------------- +-- some inspiration from here +-- https://en.wikipedia.org/wiki/Athyrium_yokoscense +-- http://www.mygarden.net.au/gardening/athyrium-yokoscense/3900/1 +----------------------------------------------------------------------------------------------- + +abstract_ferns.grow_fern = function(pos) + local fern_size = math.random(1,4) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + + if minetest.env:get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.env:get_node(right_here).name == "default:junglegrass" then + + if fern_size == 1 then + minetest.env:add_node(right_here, {name="ferns:fern_01"}) + elseif fern_size <= 3 then + minetest.env:add_node(right_here, {name="ferns:fern_02"}) + else -- fern_size == 4 then + minetest.env:add_node(right_here, {name="ferns:fern_03"}) + end + end +end + +----------------------------------------------------------------------------------------------- +-- FERN (large) +----------------------------------------------------------------------------------------------- +minetest.register_alias("archaeplantae:fern", "ferns:fern_03") -- support old versions + +minetest.register_node("ferns:fern_03", { + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + --tiles = {"[combine:32x32:0,0=top_left.png:0,16=bottom_left.png:16,0=top_right.png:16,16=bottom_right.png"}, + tiles = {"ferns_fern_big.png"}, + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1,not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, + drop = "ferns:fern_01", +}) +----------------------------------------------------------------------------------------------- +-- FERN (medium) +----------------------------------------------------------------------------------------------- +minetest.register_alias("archaeplantae:fern_mid", "ferns:fern_02") -- support old versions + +minetest.register_node("ferns:fern_02", { + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"ferns_fern_mid.png"}, + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1,not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, + drop = "ferns:fern_01", +}) +----------------------------------------------------------------------------------------------- +-- FERN (small) +----------------------------------------------------------------------------------------------- +minetest.register_alias("archaeplantae:fern_small", "ferns:fern_01") -- support old versions +minetest.register_alias("ferns:fern_04", "ferns:fern_02") -- for placing + +minetest.register_node("ferns:fern_01", { + description = "Lady-fern (Athyrium)", -- divinationis + drawtype = "plantlike", + paramtype = "light", + tiles = {"ferns_fern.png"}, + inventory_image = "ferns_fern.png", + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, + on_place = function(itemstack, placer, pointed_thing) + -- place a random fern + local stack = ItemStack("ferns:fern_0"..math.random(1,4)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("ferns:fern_01 "..itemstack:get_count()-(1-ret:get_count())) + end, +}) +----------------------------------------------------------------------------------------------- +-- Spawning +----------------------------------------------------------------------------------------------- +--[[plantslib:spawn_on_surfaces({ + spawn_delay = 1200, + spawn_plants = {"ferns:fern"}, + spawn_chance = 800, + spawn_surfaces = { + "default:dirt_with_grass", + "default:mossycobble", + "dryplants:grass_short", + "default:jungletree", + "stoneage:grass_with_silex" + }, + seed_diff = 329, +}) +plantslib:spawn_on_surfaces({ + spawn_delay = 1200, + spawn_plants = {"ferns:fern_mid"}, + spawn_chance = 400, + spawn_surfaces = { + "default:dirt_with_grass", + "default:mossycobble", + "dryplants:grass_short", + "default:jungletree", + "stoneage:grass_with_silex" + }, + seed_diff = 329, +})]] +if Ferns_near_Tree == true then +plantslib:register_generate_plant({ -- near trees (woodlands) + surface = { + "default:dirt_with_grass", + "default:mossycobble", + "default:desert_sand", + "default:sand", + "default:jungletree", + "stoneage:grass_with_silex", + "sumpf:sumpf" + }, + max_count = 30, + rarity = 62,--63, + min_elevation = 1, -- above sea level + near_nodes = {"group:tree"}, + near_nodes_size = 3,--4, + near_nodes_vertical = 2,--3, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, -- 55 °C (too hot?) + temp_min = 0.75, -- -12 °C + check_air = false, + }, + "abstract_ferns.grow_fern" +) +end + +if Ferns_near_Rock == true then +plantslib:register_generate_plant({ -- near stone (mountains) + surface = { + "default:dirt_with_grass", + "default:mossycobble", + "group:falling_node", + --"default:jungletree", + "stoneage:grass_with_silex", + "sumpf:sumpf" + }, + max_count = 35, + rarity = 40, + min_elevation = 1, -- above sea level + near_nodes = {"group:stone"}, + near_nodes_size = 1, + near_nodes_count = 16, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, -- 55 °C (too hot?) + temp_min = 0.75, -- -12 °C + check_air = false, + }, + "abstract_ferns.grow_fern" +) +end + +if Ferns_near_Ores == true then -- this one causes a huge fps drop +plantslib:register_generate_plant({ -- near ores (potential mining sites) + surface = { + "default:dirt_with_grass", + "default:mossycobble", + "default:stone_with_coal", + "default:stone_with_iron", + "moreores:mineral_tin", + "moreores:mineral_silver", + "sumpf:sumpf" + }, + max_count = 1200,--1600, -- maybe too much? :D + rarity = 25,--15, + min_elevation = 1, -- above sea level + near_nodes = { + "default:stone_with_iron", + --"default:stone_with_copper", + --"default:stone_with_mese", + --"default:stone_with_gold", + --"default:stone_with_diamond", + "moreores:mineral_tin", + "moreores:mineral_silver" + --"moreores:mineral_mithril" + }, + near_nodes_size = 2, + near_nodes_vertical = 4,--5,--6, + near_nodes_count = 2,--3, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, -- 55 °C (too hot?) + temp_min = 0.75, -- -12 °C + check_air = false, + }, + "abstract_ferns.grow_fern" +) +end + +if Ferns_in_Groups == true then -- this one is meant as a replacement of Ferns_near_Ores +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "default:mossycobble", + "default:stone_with_coal", + "default:stone_with_iron", + "moreores:mineral_tin", + "moreores:mineral_silver", + "sumpf:sumpf" + }, + max_count = 70, + rarity = 25,--15, + min_elevation = 1, -- above sea level + near_nodes = { + "default:stone" + }, + near_nodes_size = 2, + near_nodes_vertical = 2,--6, + near_nodes_count = 3, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, -- 55 °C (too hot?) + temp_min = 0.75, -- -12 °C + check_air = false, + }, + "abstract_ferns.grow_fern" +) +end \ No newline at end of file diff --git a/ferns/gianttreefern.lua b/ferns/gianttreefern.lua new file mode 100644 index 0000000..bc45f76 --- /dev/null +++ b/ferns/gianttreefern.lua @@ -0,0 +1,408 @@ +----------------------------------------------------------------------------------------------- +-- Ferns - Giant Tree Fern 0.1.1 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: 4seasons, default +-- Supports: vines +----------------------------------------------------------------------------------------------- + +-- lot of code, lot to load + +abstract_ferns.grow_giant_tree_fern = function(pos) + local size = math.random(12,16) + local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} + + local leave_a_1 = {x = pos.x + 1, y = pos.y + size - 1, z = pos.z } + local leave_a_2 = {x = pos.x + 2, y = pos.y + size , z = pos.z } + local leave_a_3 = {x = pos.x + 3, y = pos.y + size - 1, z = pos.z } + local leave_a_4 = {x = pos.x + 4, y = pos.y + size - 2, z = pos.z } + + local leave_b_1 = {x = pos.x - 1, y = pos.y + size - 1, z = pos.z } + local leave_b_2 = {x = pos.x - 2, y = pos.y + size, z = pos.z } + local leave_b_3 = {x = pos.x - 3, y = pos.y + size - 1, z = pos.z } + local leave_b_4 = {x = pos.x - 4, y = pos.y + size - 2, z = pos.z } + + local leave_c_1 = {x = pos.x , y = pos.y + size - 1, z = pos.z + 1} + local leave_c_2 = {x = pos.x , y = pos.y + size , z = pos.z + 2} + local leave_c_3 = {x = pos.x , y = pos.y + size - 1, z = pos.z + 3} + local leave_c_4 = {x = pos.x , y = pos.y + size - 2, z = pos.z + 4} + + local leave_d_1 = {x = pos.x , y = pos.y + size - 1, z = pos.z - 1} + local leave_d_2 = {x = pos.x , y = pos.y + size , z = pos.z - 2} + local leave_d_3 = {x = pos.x , y = pos.y + size - 1, z = pos.z - 3} + local leave_d_4 = {x = pos.x , y = pos.y + size - 2, z = pos.z - 4} + + if minetest.env:get_node(pos_01).name == "air" -- instead of check_air = true, + or minetest.env:get_node(pos_01).name == "ferns:sapling_giant_tree_fern" + or minetest.env:get_node(pos_01).name == "default:junglegrass" then + + minetest.env:add_node({x = pos.x, y = pos.y + 1, z = pos.z}, {name="ferns:fern_trunk_big"}) + minetest.env:add_node({x = pos.x, y = pos.y + 2, z = pos.z}, {name="ferns:fern_trunk_big"}) + minetest.env:add_node({x = pos.x, y = pos.y + 3, z = pos.z}, {name="ferns:fern_trunk_big"}) + minetest.env:add_node({x = pos.x, y = pos.y + 4, z = pos.z}, {name="ferns:fern_trunk_big"}) + minetest.env:add_node({x = pos.x, y = pos.y + 5, z = pos.z}, {name="ferns:fern_trunk_big"}) + minetest.env:add_node({x = pos.x, y = pos.y + 6, z = pos.z}, {name="ferns:fern_trunk_big"}) + minetest.env:add_node({x = pos.x, y = pos.y + 7, z = pos.z}, {name="ferns:fern_trunk_big"}) + minetest.env:add_node({x = pos.x, y = pos.y + 8, z = pos.z}, {name="ferns:fern_trunk_big"}) + + if size > 11 then + minetest.env:add_node({x = pos.x, y = pos.y + 9, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 12 then + minetest.env:add_node({x = pos.x, y = pos.y + 10, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 13 then + minetest.env:add_node({x = pos.x, y = pos.y + 11, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 14 then + minetest.env:add_node({x = pos.x, y = pos.y + 12, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 15 then + minetest.env:add_node({x = pos.x, y = pos.y + 13, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 16 then + minetest.env:add_node({x = pos.x, y = pos.y + 14, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 17 then + minetest.env:add_node({x = pos.x, y = pos.y + 15, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 18 then + minetest.env:add_node({x = pos.x, y = pos.y + 16, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 19 then + minetest.env:add_node({x = pos.x, y = pos.y + 17, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 20 then + minetest.env:add_node({x = pos.x, y = pos.y + 18, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + if size > 21 then + minetest.env:add_node({x = pos.x, y = pos.y + 19, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + + minetest.env:add_node({x = pos.x, y = pos.y + size - 2, z = pos.z }, {name="ferns:fern_trunk_big_top"}) + + -- all the checking for air below is to prevent some ugly bugs (incomplete trunks of neighbouring trees), it's a bit slower, but worth the result + + if minetest.env:get_node(leave_a_1).name == "air" then + minetest.env:add_node(leave_a_1, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_a_2).name == "air" then + minetest.env:add_node(leave_a_2, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_a_3).name == "air" then + minetest.env:add_node(leave_a_3, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_a_4).name == "air" then + minetest.env:add_node(leave_a_4, {name="ferns:tree_fern_leave_big_end", param2=3}) + end + end + end + end + + if minetest.env:get_node(leave_b_1).name == "air" then + minetest.env:add_node(leave_b_1, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_b_2).name == "air" then + minetest.env:add_node(leave_b_2, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_b_3).name == "air" then + minetest.env:add_node(leave_b_3, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_b_4).name == "air" then + minetest.env:add_node(leave_b_4, {name="ferns:tree_fern_leave_big_end", param2=1}) + end + end + end + end + + if minetest.env:get_node(leave_c_1).name == "air" then + minetest.env:add_node(leave_c_1, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_c_2).name == "air" then + minetest.env:add_node(leave_c_2, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_c_3).name == "air" then + minetest.env:add_node(leave_c_3, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_c_4).name == "air" then + minetest.env:add_node(leave_c_4, {name="ferns:tree_fern_leave_big_end", param2=2}) + end + end + end + end + + if minetest.env:get_node(leave_d_1).name == "air" then + minetest.env:add_node(leave_d_1, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_d_2).name == "air" then + minetest.env:add_node(leave_d_2, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_d_3).name == "air" then + minetest.env:add_node(leave_d_3, {name="ferns:tree_fern_leave_big"}) + if minetest.env:get_node(leave_d_4).name == "air" then + minetest.env:add_node(leave_d_4, {name="ferns:tree_fern_leave_big_end", param2=0}) + end + end + end + end + + minetest.env:add_node({x = pos.x, y = pos.y + size - 1, z = pos.z }, {name="ferns:tree_fern_leaves_giant"}) + + -- bug fixes # 2 - doesn't really work, so disabled for now + --[[if minetest.env:get_node(leave_a_4).name == "ferns:tree_fern_leave_big_end" + and minetest.env:get_node(leave_a_3).name == "ferns:fern_trunk_big" then + minetest.env:add_node(leave_a_4, {name="air"}) + end + + if minetest.env:get_node(leave_b_4).name == "ferns:tree_fern_leave_big_end" + and minetest.env:get_node(leave_b_3).name == "ferns:fern_trunk_big" then + minetest.env:add_node(leave_b_4, {name="air"}) + end + + if minetest.env:get_node(leave_c_4).name == "ferns:tree_fern_leave_big_end" + and minetest.env:get_node(leave_c_3).name == "ferns:fern_trunk_big" then + minetest.env:add_node(leave_c_4, {name="air"}) + end + + if minetest.env:get_node(leave_d_4).name == "ferns:tree_fern_leave_big_end" + and minetest.env:get_node(leave_d_3).name == "ferns:fern_trunk_big" then + minetest.env:add_node(leave_d_4, {name="air"}) + end]] + + end +end + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN LEAVES +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:tree_fern_leaves_giant", { + description = "Tree Fern Crown (Dicksonia)", + drawtype = "plantlike", + visual_scale = math.sqrt(8), + paramtype = "light", + --paramtype2 = "facedir", + --tiles = {"[combine:"..TSS..T1.."ferns_5.png"..T2.."ferns_6.png"..T3.."ferns_7.png"..T4.."ferns_8.png^[transformFX^[combine:"..TSS..T1.."ferns_5.png"..T2.."ferns_6.png"..T3.."ferns_7.png"..T4.."ferns_8.png"}, + tiles = {"ferns_fern_tree_giant.png"}, + inventory_image = "ferns_fern_tree.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + attached_node=1, + not_in_creative_inventory=1 + }, + drop = { + max_items = 1, + items = { + { + items = {"ferns:sapling_giant_tree_fern"}, + rarity = 40, + }, + { + items = {"ferns:tree_fern_leaves"}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN LEAVE PART +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:tree_fern_leave_big", { + description = "Giant Tree Fern Leave", + drawtype = "raillike", + paramtype = "light", + tiles = { + "ferns_tree_fern_leave_big.png", + }, + walkable = false, + groups = { + snappy=3, + flammable=2, + attached_node=1, + not_in_creative_inventory=1 + }, + drop = "", + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN LEAVE END +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:tree_fern_leave_big_end", { + description = "Giant Tree Fern Leave End", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = { "ferns_tree_fern_leave_big_end.png" }, + walkable = false, + node_box = { + type = "fixed", +-- {left, bottom, front, right, top, back } + fixed = {-1/2, -1/2, 1/2, 1/2, 33/64, 1/2}, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, 1/2, 1/2, 33/64, 1/2}, + }, + groups = { + snappy=3, + flammable=2, + attached_node=1, + not_in_creative_inventory=1 + }, + drop = "", + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN TRUNK TOP +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:fern_trunk_big_top", { + description = "Giant Fern Trunk", + drawtype = "nodebox", + paramtype = "light", + tiles = { + "ferns_fern_trunk_big_top.png^ferns_tree_fern_leave_big_cross.png", + "ferns_fern_trunk_big_top.png^ferns_tree_fern_leave_big_cross.png", + "ferns_fern_trunk_big.png" + }, + node_box = { + type = "fixed", +-- {left, bottom, front, right, top, back } + fixed = { + {-1/2, 33/64, -1/2, 1/2, 33/64, 1/2}, + {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}, + } + }, + selection_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}, + }, + groups = { + tree=1, + choppy=2, + oddly_breakable_by_hand=2, + flammable=3, + wood=1, + not_in_creative_inventory=1, + leafdecay=3 -- to support vines + }, + drop = "ferns:fern_trunk_big", + sounds = default.node_sound_wood_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN TRUNK +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:fern_trunk_big", { + description = "Giant Fern Trunk", + drawtype = "nodebox", + paramtype = "light", + tiles = { + "ferns_fern_trunk_big_top.png", + "ferns_fern_trunk_big_top.png", + "ferns_fern_trunk_big.png" + }, + node_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}, + }, + selection_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}, + }, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), + after_destruct = function(pos,oldnode) + local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if node.name == "ferns:fern_trunk_big" or node.name == "ferns:fern_trunk_big_top" then + minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) + minetest.add_item(pos,"ferns:fern_trunk_big") + end + end, +}) + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN SAPLING +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:sapling_giant_tree_fern", { + description = "Giant Tree Fern Sapling", + drawtype = "plantlike", + paramtype = "light", + tiles = {"ferns_sapling_tree_fern_giant.png"}, + inventory_image = "ferns_sapling_tree_fern_giant.png", + walkable = false, + groups = {snappy=3,flammable=2,flora=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) + +-- abm +minetest.register_abm({ + nodenames = "ferns:sapling_giant_tree_fern", + interval = 1000, + chance = 4, + action = function(pos, node, _, _) + abstract_ferns.grow_giant_tree_fern({x = pos.x, y = pos.y-1, z = pos.z}) + end +}) + +----------------------------------------------------------------------------------------------- +-- GENERATE GIANT TREE FERN +----------------------------------------------------------------------------------------------- +-- in jungles +if Giant_Tree_Ferns_in_Jungle == true then +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "default:sand", + "default:desert_sand"--, + --"dryplants:grass_short" + }, + max_count = 12,--27, + avoid_nodes = {"group:tree"}, + avoid_radius = 3,--4, + rarity = 85, + seed_diff = 329, + min_elevation = 1, + near_nodes = {"default:jungletree"}, + near_nodes_size = 6, + near_nodes_vertical = 2,--4, + near_nodes_count = 1, + plantlife_limit = -0.9, + --humidity_max = 0.39,--1.0, + --humidity_min = 0.5, + --temp_max = -1,-- -1.2,-- -0.5, -- ~ 55 °C + --temp_min = -0.35,-- -0.07, -- ~ 25 °C + check_air = false, + }, + "abstract_ferns.grow_giant_tree_fern" +) +end + +-- for oases & tropical beaches +if Giant_Tree_Ferns_for_Oases == true then +plantslib:register_generate_plant({ + surface = { + "default:sand"--, + --"default:desert_sand" + }, + max_count = 10,--27, + rarity = 90, + seed_diff = 329, + neighbors = {"default:desert_sand"}, + ncount = 1, + min_elevation = 1, + near_nodes = {"default:water_source"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 1.0, + temp_max = -1.0, + temp_min = 1.0, + check_air = false, + }, + "abstract_ferns.grow_giant_tree_fern" +) +end \ No newline at end of file diff --git a/ferns/horsetail.lua b/ferns/horsetail.lua new file mode 100644 index 0000000..464e8c9 --- /dev/null +++ b/ferns/horsetail.lua @@ -0,0 +1,174 @@ +----------------------------------------------------------------------------------------------- +-- Archae Plantae - Horsetail 0.0.5 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default, flowers, trees +-- Dependencies: plants_lib +-- Supports: dryplants, stoneage, sumpf +----------------------------------------------------------------------------------------------- + +abstract_ferns.grow_horsetail = function(pos) + local horsetail_size = math.random(1,4) + if horsetail_size == 1 then + minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name="ferns:horsetail_01"}) + elseif horsetail_size == 2 then + minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name="ferns:horsetail_02"}) + elseif horsetail_size == 3 then + minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name="ferns:horsetail_03"}) + elseif horsetail_size == 4 then + minetest.env:add_node({x=pos.x, y=pos.y+1, z=pos.z}, {name="ferns:horsetail_04"}) + end +end + +----------------------------------------------------------------------------------------------- +-- HORSETAIL (EQUISETUM) +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:horsetail_01", { + description = "Young Horsetail (Equisetum)", + drawtype = "plantlike", + paramtype = "light", + tiles = {"ferns_horsetail_01.png"}, + inventory_image = "ferns_horsetail_01.png", + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1,horsetail=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.15, -1/2, -0.15, 0.15, -1/16, 0.15 }, + }, + on_use = minetest.item_eat(1), -- young ones edible https://en.wikipedia.org/wiki/Equisetum +}) +minetest.register_node("ferns:horsetail_02", { + drawtype = "plantlike", + paramtype = "light", + tiles = {"ferns_horsetail_02.png"}, + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1,horsetail=1,not_in_creative_inventory=1}, + drop = "ferns:horsetail_04", + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.15, -1/2, -0.15, 0.15, 1/16, 0.15 }, + }, +}) +minetest.register_node("ferns:horsetail_03", { + drawtype = "plantlike", + paramtype = "light", + tiles = {"ferns_horsetail_03.png"}, + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1,horsetail=1,not_in_creative_inventory=1}, + drop = "ferns:horsetail_04", + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.15, -1/2, -0.15, 0.15, 4/16, 0.15 }, + }, +}) +minetest.register_node("ferns:horsetail_04", { -- the one in inventory + description = "Horsetail (Equisetum)", + drawtype = "plantlike", + paramtype = "light", + tiles = {"ferns_horsetail_04.png"}, + inventory_image = "ferns_horsetail_04.png", + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1,horsetail=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.15, -1/2, -0.15, 0.15, 7/16, 0.15 }, + }, + on_place = function(itemstack, placer, pointed_thing) + -- place a random horsetail + local stack = ItemStack("ferns:horsetail_0"..math.random(2,4)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("ferns:horsetail_04 "..itemstack:get_count()-(1-ret:get_count())) + end, +}) + +----------------------------------------------------------------------------------------------- +-- Spawning +----------------------------------------------------------------------------------------------- +if Horsetails_Spawning == true then +plantslib:spawn_on_surfaces({ + spawn_delay = 1200, + spawn_plants = { + "ferns:horsetail_01", + "ferns:horsetail_02", + "ferns:horsetail_03", + "ferns:horsetail_04" + }, + spawn_chance = 400, + spawn_surfaces = { + "default:dirt_with_grass", + "default:desert_sand", + "default:sand", + "dryplants:grass_short", + "stoneage:grass_with_silex", + "default:mossycobble", + "default:gravel" + }, + seed_diff = 329, + min_elevation = 1, -- above sea level + near_nodes = {"default:water_source","default:gravel"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, +}) +end +----------------------------------------------------------------------------------------------- +-- Generating +----------------------------------------------------------------------------------------------- +if Horsetails_on_Grass == true then +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "sumpf:sumpf" + }, + max_count = 35, + rarity = 40, + min_elevation = 1, -- above sea level + near_nodes = { + "group:water", -- likes water (of course) + "default:gravel", -- near those on gravel + "default:sand", -- some like sand + "default:clay", -- some like clay + "stoneage:grass_with_silex", + "default:mossycobble", + "default:cobble", + "sumpf:sumpf" + }, + near_nodes_size = 3, + near_nodes_vertical = 2,--3, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_min = 0.4, + temp_max = -0.5, -- 55 °C + temp_min = 0.53, -- 0 °C, dies back in winter + }, + "abstract_ferns.grow_horsetail" +) +end + +if Horsetails_on_Stony == true then +plantslib:register_generate_plant({ + surface = { + "default:gravel", -- roots go deep + "default:mossycobble", + "stoneage:dirt_with_silex", + "stoneage:grass_with_silex", + "stoneage:sand_with_silex"--, -- roots go deep + --"sumpf:sumpf" + }, + max_count = 35, + rarity = 20, + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + humidity_min = 0.4, + temp_max = -0.5, -- 55 °C + temp_min = 0.53, -- 0 °C, dies back in winter + }, + "abstract_ferns.grow_horsetail" +) +end \ No newline at end of file diff --git a/ferns/init.lua b/ferns/init.lua new file mode 100644 index 0000000..2d389ce --- /dev/null +++ b/ferns/init.lua @@ -0,0 +1,33 @@ +----------------------------------------------------------------------------------------------- +local title = "Ferns" -- former "Archae Plantae" +local version = "0.1.2" +local mname = "ferns" -- former "archaeplantae" +----------------------------------------------------------------------------------------------- +-- (by Mossmanikin) +-- License (everything): WTFPL +----------------------------------------------------------------------------------------------- +abstract_ferns = {} + +dofile(minetest.get_modpath("ferns").."/SeTTiNGS.txt") + +if Lady_fern == true then +dofile(minetest.get_modpath("ferns").."/fern.lua") +end + +if Horsetails == true then + dofile(minetest.get_modpath("ferns").."/horsetail.lua") +end + +if Tree_Fern == true then + dofile(minetest.get_modpath("ferns").."/treefern.lua") +end + +if Giant_Tree_Fern == true then + dofile(minetest.get_modpath("ferns").."/gianttreefern.lua") +end + +dofile(minetest.get_modpath("ferns").."/crafting.lua") + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/ferns/textures/ferns_5.png b/ferns/textures/ferns_5.png new file mode 100644 index 0000000..de87d3a Binary files /dev/null and b/ferns/textures/ferns_5.png differ diff --git a/ferns/textures/ferns_6.png b/ferns/textures/ferns_6.png new file mode 100644 index 0000000..7ca1c3f Binary files /dev/null and b/ferns/textures/ferns_6.png differ diff --git a/ferns/textures/ferns_7.png b/ferns/textures/ferns_7.png new file mode 100644 index 0000000..7165881 Binary files /dev/null and b/ferns/textures/ferns_7.png differ diff --git a/ferns/textures/ferns_8.png b/ferns/textures/ferns_8.png new file mode 100644 index 0000000..4a55895 Binary files /dev/null and b/ferns/textures/ferns_8.png differ diff --git a/ferns/textures/ferns_fern.png b/ferns/textures/ferns_fern.png new file mode 100644 index 0000000..36f50f9 Binary files /dev/null and b/ferns/textures/ferns_fern.png differ diff --git a/ferns/textures/ferns_fern_big.png b/ferns/textures/ferns_fern_big.png new file mode 100644 index 0000000..d8ec738 Binary files /dev/null and b/ferns/textures/ferns_fern_big.png differ diff --git a/ferns/textures/ferns_fern_mid.png b/ferns/textures/ferns_fern_mid.png new file mode 100644 index 0000000..4270e96 Binary files /dev/null and b/ferns/textures/ferns_fern_mid.png differ diff --git a/ferns/textures/ferns_fern_tree.png b/ferns/textures/ferns_fern_tree.png new file mode 100644 index 0000000..10c9f66 Binary files /dev/null and b/ferns/textures/ferns_fern_tree.png differ diff --git a/ferns/textures/ferns_fern_tree_giant.png b/ferns/textures/ferns_fern_tree_giant.png new file mode 100644 index 0000000..f8f1189 Binary files /dev/null and b/ferns/textures/ferns_fern_tree_giant.png differ diff --git a/ferns/textures/ferns_fern_tree_inv.png b/ferns/textures/ferns_fern_tree_inv.png new file mode 100644 index 0000000..1ea2e43 Binary files /dev/null and b/ferns/textures/ferns_fern_tree_inv.png differ diff --git a/ferns/textures/ferns_fern_tree_tl.png b/ferns/textures/ferns_fern_tree_tl.png new file mode 100644 index 0000000..6b2f286 Binary files /dev/null and b/ferns/textures/ferns_fern_tree_tl.png differ diff --git a/ferns/textures/ferns_fern_tree_tr.png b/ferns/textures/ferns_fern_tree_tr.png new file mode 100644 index 0000000..c00aeec Binary files /dev/null and b/ferns/textures/ferns_fern_tree_tr.png differ diff --git a/ferns/textures/ferns_fern_trunk.png b/ferns/textures/ferns_fern_trunk.png new file mode 100644 index 0000000..a8e1bf6 Binary files /dev/null and b/ferns/textures/ferns_fern_trunk.png differ diff --git a/ferns/textures/ferns_fern_trunk_big.png b/ferns/textures/ferns_fern_trunk_big.png new file mode 100644 index 0000000..057e5ec Binary files /dev/null and b/ferns/textures/ferns_fern_trunk_big.png differ diff --git a/ferns/textures/ferns_fern_trunk_big_top.png b/ferns/textures/ferns_fern_trunk_big_top.png new file mode 100644 index 0000000..22d5523 Binary files /dev/null and b/ferns/textures/ferns_fern_trunk_big_top.png differ diff --git a/ferns/textures/ferns_fern_trunk_top.png b/ferns/textures/ferns_fern_trunk_top.png new file mode 100644 index 0000000..03d789b Binary files /dev/null and b/ferns/textures/ferns_fern_trunk_top.png differ diff --git a/ferns/textures/ferns_ferntuber.png b/ferns/textures/ferns_ferntuber.png new file mode 100644 index 0000000..c745194 Binary files /dev/null and b/ferns/textures/ferns_ferntuber.png differ diff --git a/ferns/textures/ferns_ferntuber_roasted.png b/ferns/textures/ferns_ferntuber_roasted.png new file mode 100644 index 0000000..de610ae Binary files /dev/null and b/ferns/textures/ferns_ferntuber_roasted.png differ diff --git a/ferns/textures/ferns_fiddlehead.png b/ferns/textures/ferns_fiddlehead.png new file mode 100644 index 0000000..b1796b8 Binary files /dev/null and b/ferns/textures/ferns_fiddlehead.png differ diff --git a/ferns/textures/ferns_fiddlehead_roasted.png b/ferns/textures/ferns_fiddlehead_roasted.png new file mode 100644 index 0000000..3a3d72c Binary files /dev/null and b/ferns/textures/ferns_fiddlehead_roasted.png differ diff --git a/ferns/textures/ferns_horsetail_01.png b/ferns/textures/ferns_horsetail_01.png new file mode 100644 index 0000000..90aeada Binary files /dev/null and b/ferns/textures/ferns_horsetail_01.png differ diff --git a/ferns/textures/ferns_horsetail_02.png b/ferns/textures/ferns_horsetail_02.png new file mode 100644 index 0000000..7ceae5c Binary files /dev/null and b/ferns/textures/ferns_horsetail_02.png differ diff --git a/ferns/textures/ferns_horsetail_03.png b/ferns/textures/ferns_horsetail_03.png new file mode 100644 index 0000000..3ec3a1d Binary files /dev/null and b/ferns/textures/ferns_horsetail_03.png differ diff --git a/ferns/textures/ferns_horsetail_04.png b/ferns/textures/ferns_horsetail_04.png new file mode 100644 index 0000000..9cab02d Binary files /dev/null and b/ferns/textures/ferns_horsetail_04.png differ diff --git a/ferns/textures/ferns_sapling_tree_fern.png b/ferns/textures/ferns_sapling_tree_fern.png new file mode 100644 index 0000000..63d5d59 Binary files /dev/null and b/ferns/textures/ferns_sapling_tree_fern.png differ diff --git a/ferns/textures/ferns_sapling_tree_fern_giant.png b/ferns/textures/ferns_sapling_tree_fern_giant.png new file mode 100644 index 0000000..6bccc99 Binary files /dev/null and b/ferns/textures/ferns_sapling_tree_fern_giant.png differ diff --git a/ferns/textures/ferns_tree_fern_leave_big.png b/ferns/textures/ferns_tree_fern_leave_big.png new file mode 100644 index 0000000..93cbebc Binary files /dev/null and b/ferns/textures/ferns_tree_fern_leave_big.png differ diff --git a/ferns/textures/ferns_tree_fern_leave_big_cross.png b/ferns/textures/ferns_tree_fern_leave_big_cross.png new file mode 100644 index 0000000..b1c9600 Binary files /dev/null and b/ferns/textures/ferns_tree_fern_leave_big_cross.png differ diff --git a/ferns/textures/ferns_tree_fern_leave_big_end.png b/ferns/textures/ferns_tree_fern_leave_big_end.png new file mode 100644 index 0000000..d850d3a Binary files /dev/null and b/ferns/textures/ferns_tree_fern_leave_big_end.png differ diff --git a/ferns/textures/not_in_use/archaeplantae_horsetails.png b/ferns/textures/not_in_use/archaeplantae_horsetails.png new file mode 100644 index 0000000..f3558f7 Binary files /dev/null and b/ferns/textures/not_in_use/archaeplantae_horsetails.png differ diff --git a/ferns/textures/not_in_use/big picture 3.png b/ferns/textures/not_in_use/big picture 3.png new file mode 100644 index 0000000..d5d1c54 Binary files /dev/null and b/ferns/textures/not_in_use/big picture 3.png differ diff --git a/ferns/textures/not_in_use/ferns_fern_big_left.png b/ferns/textures/not_in_use/ferns_fern_big_left.png new file mode 100644 index 0000000..e7e747a Binary files /dev/null and b/ferns/textures/not_in_use/ferns_fern_big_left.png differ diff --git a/ferns/textures/not_in_use/ferns_fern_big_right.png b/ferns/textures/not_in_use/ferns_fern_big_right.png new file mode 100644 index 0000000..99b29ab Binary files /dev/null and b/ferns/textures/not_in_use/ferns_fern_big_right.png differ diff --git a/ferns/textures/not_in_use/ferns_fern_mid_left.png b/ferns/textures/not_in_use/ferns_fern_mid_left.png new file mode 100644 index 0000000..64cc6a7 Binary files /dev/null and b/ferns/textures/not_in_use/ferns_fern_mid_left.png differ diff --git a/ferns/textures/not_in_use/ferns_fern_mid_right.png b/ferns/textures/not_in_use/ferns_fern_mid_right.png new file mode 100644 index 0000000..3c6c4e8 Binary files /dev/null and b/ferns/textures/not_in_use/ferns_fern_mid_right.png differ diff --git a/ferns/textures/not_in_use/ferns_fern_tree_bl.png b/ferns/textures/not_in_use/ferns_fern_tree_bl.png new file mode 100644 index 0000000..b96e4fa Binary files /dev/null and b/ferns/textures/not_in_use/ferns_fern_tree_bl.png differ diff --git a/ferns/textures/not_in_use/ferns_fern_tree_br.png b/ferns/textures/not_in_use/ferns_fern_tree_br.png new file mode 100644 index 0000000..efaf5db Binary files /dev/null and b/ferns/textures/not_in_use/ferns_fern_tree_br.png differ diff --git a/ferns/textures/not_in_use/ferns_fern_trunk_big_crown.png b/ferns/textures/not_in_use/ferns_fern_trunk_big_crown.png new file mode 100644 index 0000000..b4d18b3 Binary files /dev/null and b/ferns/textures/not_in_use/ferns_fern_trunk_big_crown.png differ diff --git a/ferns/textures/old/archaeplantae_fern_old4.png b/ferns/textures/old/archaeplantae_fern_old4.png new file mode 100644 index 0000000..4bd33e9 Binary files /dev/null and b/ferns/textures/old/archaeplantae_fern_old4.png differ diff --git a/ferns/textures/old/comb.png b/ferns/textures/old/comb.png new file mode 100644 index 0000000..dca2800 Binary files /dev/null and b/ferns/textures/old/comb.png differ diff --git a/ferns/textures/old/ferns_5_old.png b/ferns/textures/old/ferns_5_old.png new file mode 100644 index 0000000..d5ee89a Binary files /dev/null and b/ferns/textures/old/ferns_5_old.png differ diff --git a/ferns/textures/old/ferns_6_old.png b/ferns/textures/old/ferns_6_old.png new file mode 100644 index 0000000..3d65b2a Binary files /dev/null and b/ferns/textures/old/ferns_6_old.png differ diff --git a/ferns/textures/old/ferns_7_old.png b/ferns/textures/old/ferns_7_old.png new file mode 100644 index 0000000..b0ee0c6 Binary files /dev/null and b/ferns/textures/old/ferns_7_old.png differ diff --git a/ferns/textures/old/ferns_fern_big_old.png b/ferns/textures/old/ferns_fern_big_old.png new file mode 100644 index 0000000..46445f0 Binary files /dev/null and b/ferns/textures/old/ferns_fern_big_old.png differ diff --git a/ferns/textures/old/ferns_fern_mid_old.png b/ferns/textures/old/ferns_fern_mid_old.png new file mode 100644 index 0000000..e21cc55 Binary files /dev/null and b/ferns/textures/old/ferns_fern_mid_old.png differ diff --git a/ferns/textures/old/ferns_fern_tree_old.png b/ferns/textures/old/ferns_fern_tree_old.png new file mode 100644 index 0000000..fb58d34 Binary files /dev/null and b/ferns/textures/old/ferns_fern_tree_old.png differ diff --git a/ferns/textures/old/ferns_fern_trunk_big_old2.png b/ferns/textures/old/ferns_fern_trunk_big_old2.png new file mode 100644 index 0000000..a048ee0 Binary files /dev/null and b/ferns/textures/old/ferns_fern_trunk_big_old2.png differ diff --git a/ferns/textures/old/ferns_fern_trunk_big_top_old.png b/ferns/textures/old/ferns_fern_trunk_big_top_old.png new file mode 100644 index 0000000..1efdbd8 Binary files /dev/null and b/ferns/textures/old/ferns_fern_trunk_big_top_old.png differ diff --git a/ferns/textures/old/ferns_fern_trunk_big_top_old2.png b/ferns/textures/old/ferns_fern_trunk_big_top_old2.png new file mode 100644 index 0000000..4a4ee87 Binary files /dev/null and b/ferns/textures/old/ferns_fern_trunk_big_top_old2.png differ diff --git a/ferns/textures/old/ferns_fern_trunk_top_old.png b/ferns/textures/old/ferns_fern_trunk_top_old.png new file mode 100644 index 0000000..f8fcc96 Binary files /dev/null and b/ferns/textures/old/ferns_fern_trunk_top_old.png differ diff --git a/ferns/textures/old/ferns_horsetail_01_old2.png b/ferns/textures/old/ferns_horsetail_01_old2.png new file mode 100644 index 0000000..9605412 Binary files /dev/null and b/ferns/textures/old/ferns_horsetail_01_old2.png differ diff --git a/ferns/textures/old/ferns_horsetail_02_old2.png b/ferns/textures/old/ferns_horsetail_02_old2.png new file mode 100644 index 0000000..46614ff Binary files /dev/null and b/ferns/textures/old/ferns_horsetail_02_old2.png differ diff --git a/ferns/textures/old/ferns_horsetail_03_old2.png b/ferns/textures/old/ferns_horsetail_03_old2.png new file mode 100644 index 0000000..153f354 Binary files /dev/null and b/ferns/textures/old/ferns_horsetail_03_old2.png differ diff --git a/ferns/textures/old/ferns_horsetail_04_old2.png b/ferns/textures/old/ferns_horsetail_04_old2.png new file mode 100644 index 0000000..bb12dc2 Binary files /dev/null and b/ferns/textures/old/ferns_horsetail_04_old2.png differ diff --git a/ferns/textures/old/ferns_tree_fern_leave_big_cross_old.png b/ferns/textures/old/ferns_tree_fern_leave_big_cross_old.png new file mode 100644 index 0000000..1e19292 Binary files /dev/null and b/ferns/textures/old/ferns_tree_fern_leave_big_cross_old.png differ diff --git a/ferns/textures/old/ferns_tree_fern_leave_big_end_old.png b/ferns/textures/old/ferns_tree_fern_leave_big_end_old.png new file mode 100644 index 0000000..6af642f Binary files /dev/null and b/ferns/textures/old/ferns_tree_fern_leave_big_end_old.png differ diff --git a/ferns/textures/old/ferns_tree_fern_leave_big_old.png b/ferns/textures/old/ferns_tree_fern_leave_big_old.png new file mode 100644 index 0000000..3c34ad9 Binary files /dev/null and b/ferns/textures/old/ferns_tree_fern_leave_big_old.png differ diff --git a/ferns/treefern.lua b/ferns/treefern.lua new file mode 100644 index 0000000..c92c445 --- /dev/null +++ b/ferns/treefern.lua @@ -0,0 +1,247 @@ +----------------------------------------------------------------------------------------------- +-- Ferns - Tree Fern 0.1.1 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default , trees +----------------------------------------------------------------------------------------------- + +abstract_ferns.grow_tree_fern = function(pos) + local size = math.random(1,5) + local crown = math.random(1,2) + local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} + local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z} + local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z} + local pos_04 = {x = pos.x, y = pos.y + 4, z = pos.z} + local pos_05 = {x = pos.x, y = pos.y + 5, z = pos.z} + + if minetest.env:get_node(pos_01).name == "air" -- instead of check_air = true, + or minetest.env:get_node(pos_01).name == "ferns:sapling_tree_fern" + or minetest.env:get_node(pos_01).name == "default:junglegrass" then + + if minetest.env:get_node(pos_02).name ~= "air" + or size == 1 then + minetest.env:add_node(pos_01, {name="ferns:tree_fern_leaves"}) + + elseif minetest.env:get_node(pos_03).name ~= "air" + or size == 2 then + minetest.env:add_node(pos_01, {name="ferns:fern_trunk"}) + if crown == 1 then + minetest.env:add_node(pos_02, {name="ferns:tree_fern_leaves"}) + else + minetest.env:add_node(pos_02, {name="ferns:tree_fern_leaves_02"}) + end + + elseif minetest.env:get_node(pos_04).name ~= "air" + or size == 3 then + minetest.env:add_node(pos_01, {name="ferns:fern_trunk"}) + minetest.env:add_node(pos_02, {name="ferns:fern_trunk"}) + if crown == 1 then + minetest.env:add_node(pos_03, {name="ferns:tree_fern_leaves"}) + else + minetest.env:add_node(pos_03, {name="ferns:tree_fern_leaves_02"}) + end + + elseif minetest.env:get_node(pos_05).name ~= "air" + or size == 4 then + minetest.env:add_node(pos_01, {name="ferns:fern_trunk"}) + minetest.env:add_node(pos_02, {name="ferns:fern_trunk"}) + minetest.env:add_node(pos_03, {name="ferns:fern_trunk"}) + if crown == 1 then + minetest.env:add_node(pos_04, {name="ferns:tree_fern_leaves"}) + else + minetest.env:add_node(pos_04, {name="ferns:tree_fern_leaves_02"}) + end + + elseif size == 5 then + minetest.env:add_node(pos_01, {name="ferns:fern_trunk"}) + minetest.env:add_node(pos_02, {name="ferns:fern_trunk"}) + minetest.env:add_node(pos_03, {name="ferns:fern_trunk"}) + minetest.env:add_node(pos_04, {name="ferns:fern_trunk"}) + if crown == 1 then + minetest.env:add_node(pos_05, {name="ferns:tree_fern_leaves"}) + else + minetest.env:add_node(pos_05, {name="ferns:tree_fern_leaves_02"}) + end + + end + end +end + +----------------------------------------------------------------------------------------------- +-- TREE FERN LEAVES +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:tree_fern_leaves", { + description = "Tree Fern Crown (Dicksonia)", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + paramtype2 = "facedir", + --tiles = {"[combine:32x32:0,0=top_left.png:0,16=bottom_left.png:16,0=top_right.png:16,16=bottom_right.png"}, + tiles = {"ferns_fern_tree.png"}, + inventory_image = "ferns_fern_tree_inv.png", + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1}, + drop = { + max_items = 1, + items = { + { + items = {"ferns:sapling_tree_fern"}, + rarity = 20, + }, + { + items = {"ferns:tree_fern_leaves"}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) +minetest.register_node("ferns:tree_fern_leaves_02", { + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"ferns_fern_big.png"}, + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1,not_in_creative_inventory=1}, + drop = { + max_items = 1, + items = { + { + items = {"ferns:sapling_tree_fern"}, + rarity = 20, + }, + { + items = {"ferns:tree_fern_leaves"}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) +----------------------------------------------------------------------------------------------- +-- FERN TRUNK +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:fern_trunk", { + description = "Fern Trunk (Dicksonia)", + drawtype = "nodebox", + paramtype = "light", + tiles = { + "ferns_fern_trunk_top.png", + "ferns_fern_trunk_top.png", + "ferns_fern_trunk.png" + }, + node_box = { + type = "fixed", + fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}, + }, + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), + after_destruct = function(pos,oldnode) + local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if node.name == "ferns:fern_trunk" then + minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) + minetest.add_item(pos,"ferns:fern_trunk") + end + end, +}) + +----------------------------------------------------------------------------------------------- +-- TREE FERN SAPLING +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:sapling_tree_fern", { + description = "Tree Fern Sapling (Dicksonia)", + drawtype = "plantlike", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"ferns_sapling_tree_fern.png"}, + inventory_image = "ferns_sapling_tree_fern.png", + walkable = false, + groups = {snappy=3,flammable=2,flora=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) +-- abm +minetest.register_abm({ + nodenames = "ferns:sapling_tree_fern", + interval = 1000, + chance = 4, + action = function(pos, node, _, _) + abstract_ferns.grow_tree_fern({x = pos.x, y = pos.y-1, z = pos.z}) + end +}) + +----------------------------------------------------------------------------------------------- +-- GENERATE TREE FERN +----------------------------------------------------------------------------------------------- +-- in jungles +if Tree_Ferns_in_Jungle == true then +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "default:sand", + "default:desert_sand"--, + --"dryplants:grass_short" + }, + max_count = 35,--27, + avoid_nodes = {"default:tree"}, + avoid_radius = 4, + rarity = 50, + seed_diff = 329, + min_elevation = -10, + near_nodes = {"default:jungletree"}, + near_nodes_size = 6, + near_nodes_vertical = 2,--4, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, + temp_min = 0.13, + check_air = false, + }, + "abstract_ferns.grow_tree_fern" +) +end + +-- for oases & tropical beaches +if Tree_Ferns_for_Oases == true then +plantslib:register_generate_plant({ + surface = { + "default:sand"--, + --"default:desert_sand" + }, + max_count = 35, + rarity = 50, + seed_diff = 329, + neighbors = {"default:desert_sand"}, + ncount = 1, + min_elevation = 1, + near_nodes = {"default:water_source"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 1.0, + temp_max = -1.0, + temp_min = 1.0, + check_air = false, + }, + "abstract_ferns.grow_tree_fern" +) +end diff --git a/molehills/depends.txt b/molehills/depends.txt new file mode 100644 index 0000000..bde0bdf --- /dev/null +++ b/molehills/depends.txt @@ -0,0 +1,2 @@ +default +plants_lib \ No newline at end of file diff --git a/molehills/init.lua b/molehills/init.lua new file mode 100644 index 0000000..c80e7cc --- /dev/null +++ b/molehills/init.lua @@ -0,0 +1,110 @@ +----------------------------------------------------------------------------------------------- +local title = "Mole Hills" +local version = "0.0.3" +local mname = "molehills" +----------------------------------------------------------------------------------------------- +-- Idea by Sokomine +-- Code & textures by Mossmanikin + +abstract_molehills = {} + +dofile(minetest.get_modpath("molehills").."/molehills_settings.txt") + +----------------------------------------------------------------------------------------------- +-- NoDe +----------------------------------------------------------------------------------------------- +minetest.register_node("molehills:molehill",{ + drawtype = "nodebox", + description = "Mole Hill", + inventory_image = "molehills_side.png", + tiles = { + "molehills_dirt.png",--"molehill_top.png", + "molehills_dirt.png",--"molehill_top.png", + "molehills_dirt.png"--"molehill_side.png" + }, + paramtype = "light", + node_box = { + type = "fixed", + fixed = { +-- { left, bottom, front, right, top, back} + {-2/16, -3/16, -1/16, 2/16, -2/16, 1/16}, + {-1/16, -3/16, -2/16, 1/16, -2/16, 2/16}, +-- { left, bottom, front, right, top, back} + {-4/16, -4/16, -2/16, 4/16, -3/16, 2/16}, + {-2/16, -4/16, -4/16, 2/16, -3/16, 4/16}, + {-3/16, -4/16, -3/16, 3/16, -3/16, 3/16}, +-- { left, bottom, front, right, top, back} + {-5/16, -5/16, -2/16, 5/16, -4/16, 2/16}, + {-2/16, -5/16, -5/16, 2/16, -4/16, 5/16}, + {-4/16, -5/16, -4/16, 4/16, -4/16, 4/16}, +-- { left, bottom, front, right, top, back} + {-6/16, -6/16, -2/16, 6/16, -5/16, 2/16}, + {-2/16, -6/16, -6/16, 2/16, -5/16, 6/16}, + {-5/16, -6/16, -4/16, 5/16, -5/16, 4/16}, + {-4/16, -6/16, -5/16, 4/16, -5/16, 5/16}, +-- { left, bottom, front, right, top, back} + {-7/16, -7/16, -3/16, 7/16, -6/16, 3/16}, + {-3/16, -7/16, -7/16, 3/16, -6/16, 7/16}, + {-6/16, -7/16, -4/16, 6/16, -6/16, 4/16}, + {-4/16, -7/16, -6/16, 4/16, -6/16, 6/16}, + {-5/16, -7/16, -5/16, 5/16, -6/16, 5/16}, +-- { left, bottom, front, right, top, back} +--[[b]] {-1/2 , -1/2 , -3/16, 1/2 , -7/16, 3/16}, -- left to right +--[[o]] {-3/16, -1/2 , -1/2 , 3/16, -7/16, 1/2 }, -- front to back +--[[t]] {-7/16, -1/2 , -5/16, 7/16, -7/16, 5/16}, +--[[t]] {-5/16, -1/2 , -7/16, 5/16, -7/16, 7/16}, +--[[m]] {-6/16, -1/2 , -6/16, 6/16, -7/16, 6/16}, -- mid + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 2/16, 1/2}, + }, + groups = {crumbly=3}, + sounds = default.node_sound_dirt_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- CRaFTiNG +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- molehills --> dirt + output = "default:dirt", + recipe = { + {"molehills:molehill","molehills:molehill"}, + {"molehills:molehill","molehills:molehill"}, + } +}) + +----------------------------------------------------------------------------------------------- +-- GeNeRaTiNG +----------------------------------------------------------------------------------------------- +abstract_molehills.place_molehill = function(pos) + local right_here = {x=pos.x , y=pos.y+1, z=pos.z } + if minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z }).name ~= "air" + and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z }).name ~= "air" + and minetest.get_node({x=pos.x , y=pos.y, z=pos.z+1}).name ~= "air" + and minetest.get_node({x=pos.x , y=pos.y, z=pos.z-1}).name ~= "air" + and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z+1}).name ~= "air" + and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z-1}).name ~= "air" + and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z+1}).name ~= "air" + and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z-1}).name ~= "air" then + minetest.add_node(right_here, {name="molehills:molehill"}) + end +end + +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + max_count = Molehills_Max_Count, + rarity = Molehills_Rarity, + min_elevation = 1, + max_elevation = 40, + avoid_nodes = {"group:tree","group:liquid","group:stone","group:falling_node"--[[,"air"]]}, + avoid_radius = 4, + plantlife_limit = -0.3, + }, + "abstract_molehills.place_molehill" +) + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/molehills/molehills_settings.txt b/molehills/molehills_settings.txt new file mode 100644 index 0000000..2079574 --- /dev/null +++ b/molehills/molehills_settings.txt @@ -0,0 +1,6 @@ +-- Settings for generation of stuff (at map-generation time) + +Molehills_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes + +Molehills_Rarity = 87 -- larger values make molehills more rare (100 means chance of 0 %) + diff --git a/molehills/textures/molehills_dirt.png b/molehills/textures/molehills_dirt.png new file mode 100644 index 0000000..79ffa85 Binary files /dev/null and b/molehills/textures/molehills_dirt.png differ diff --git a/molehills/textures/molehills_side.png b/molehills/textures/molehills_side.png new file mode 100644 index 0000000..c82e72a Binary files /dev/null and b/molehills/textures/molehills_side.png differ diff --git a/molehills/textures/old & unused/molehill_side.png b/molehills/textures/old & unused/molehill_side.png new file mode 100644 index 0000000..dd7fed9 Binary files /dev/null and b/molehills/textures/old & unused/molehill_side.png differ diff --git a/molehills/textures/old & unused/molehill_top.png b/molehills/textures/old & unused/molehill_top.png new file mode 100644 index 0000000..fa6a5dd Binary files /dev/null and b/molehills/textures/old & unused/molehill_top.png differ diff --git a/trunks/crafting.lua b/trunks/crafting.lua new file mode 100644 index 0000000..02f3991 --- /dev/null +++ b/trunks/crafting.lua @@ -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:bushbranches2a"}} +}) +minetest.register_craft({ + output = "trunks:twig_1 4", + recipe = {{"bushes:bushbranches3"}} +}) +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", "" }, + } +}) \ No newline at end of file diff --git a/trunks/depends.txt b/trunks/depends.txt new file mode 100644 index 0000000..9c27f3b --- /dev/null +++ b/trunks/depends.txt @@ -0,0 +1,6 @@ +default +plants_lib +bushes? +ferns? +moretrees? +trees? \ No newline at end of file diff --git a/trunks/generating.lua b/trunks/generating.lua new file mode 100644 index 0000000..cd897da --- /dev/null +++ b/trunks/generating.lua @@ -0,0 +1,555 @@ +-- 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 +----------------------------------------------------------------------------------------------- + +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} + + local node_here = minetest.get_node(right_here) + local node_north = minetest.get_node(north) + local node_n_e = minetest.get_node(north_east) + local node_east = minetest.get_node(east) + local node_s_e = minetest.get_node(south_east) + local node_south = minetest.get_node(south) + local node_s_w = minetest.get_node(south_west) + local node_west = minetest.get_node(west) + local node_n_w = minetest.get_node(north_west) +-- small twigs + if twig_size <= 16 then + minetest.add_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)}) + end +-- big twigs + if Big_Twigs == true then +-- big twig 1 + if twig_size == 17 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.add_node(right_here, {name="trunks:twig_5"}) + end + if minetest.registered_nodes[node_n_e.name].buildable_to then + minetest.add_node(north_east, {name="trunks:twig_7"}) + end + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.add_node(east, {name="trunks:twig_8"}) + end + end + elseif twig_size == 18 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.add_node(right_here, {name="trunks:twig_5", param2=1}) + end + if minetest.registered_nodes[node_s_e.name].buildable_to then + minetest.add_node(south_east, {name="trunks:twig_7", param2=1}) + end + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.add_node(south, {name="trunks:twig_8", param2=1}) + end + end + elseif twig_size == 19 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.add_node(right_here, {name="trunks:twig_5", param2=2}) + end + if minetest.registered_nodes[node_s_w.name].buildable_to then + minetest.add_node(south_west, {name="trunks:twig_7", param2=2}) + end + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.add_node(west, {name="trunks:twig_8", param2=2}) + end + end + elseif twig_size == 20 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.add_node(right_here, {name="trunks:twig_5", param2=3}) + end + if minetest.registered_nodes[node_n_w.name].buildable_to then + minetest.add_node(north_west, {name="trunks:twig_7", param2=3}) + end + if minetest.registered_nodes[node_north.name].buildable_to then + minetest.add_node(north, {name="trunks:twig_8", param2=3}) + end + end +-- big twig 2 + elseif twig_size == 21 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.add_node(right_here, {name="trunks:twig_9"}) + end + if minetest.registered_nodes[node_north.name].buildable_to then + minetest.add_node(north, {name="trunks:twig_10"}) + end + if minetest.registered_nodes[node_n_e.name].buildable_to then + minetest.add_node(north_east, {name="trunks:twig_11"}) + end + end + elseif twig_size == 22 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.add_node(right_here, {name="trunks:twig_9", param2=1}) + end + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.add_node(east, {name="trunks:twig_10", param2=1}) + end + if minetest.registered_nodes[node_s_e.name].buildable_to then + minetest.add_node(south_east, {name="trunks:twig_11", param2=1}) + end + end + elseif twig_size == 23 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z-1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.add_node(right_here, {name="trunks:twig_9", param2=2}) + end + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.add_node(south, {name="trunks:twig_10", param2=2}) + end + if minetest.registered_nodes[node_s_w.name].buildable_to then + minetest.add_node(south_west, {name="trunks:twig_11", param2=2}) + end + end + elseif twig_size == 24 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.add_node(right_here, {name="trunks:twig_9", param2=3}) + end + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.add_node(west, {name="trunks:twig_10", param2=3}) + end + if minetest.registered_nodes[node_n_w.name].buildable_to then + minetest.add_node(north_west, {name="trunks:twig_11", param2=3}) + end + end + elseif twig_size <= 25 then + minetest.add_node(right_here, {name="trunks:twig_"..math.random(12,13), param2=math.random(0,3)}) + end + end +end + +if Twigs_on_ground == true then +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + max_count = Twigs_on_ground_Max_Count, + rarity = Twigs_on_ground_Rarity, + 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" +) +end + +if Twigs_on_water == true then +plantslib:register_generate_plant({ + surface = {"default:water_source"}, + max_count = Twigs_on_water_Max_Count, + rarity = Twigs_on_water_Rarity, + 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" +) +end + +----------------------------------------------------------------------------------------------- +-- TRuNKS +----------------------------------------------------------------------------------------------- +local TRuNKS = { +-- MoD TRuNK NR + {"default", "tree", 1}, + {"default", "jungletree", 2}, + + {"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", "pine_trunk", 12}, + {"moretrees", "rubber_tree_trunk", 13}, + {"moretrees", "rubber_tree_trunk_empty", 14}, + {"moretrees", "sequoia_trunk", 15}, + {"moretrees", "spruce_trunk", 16}, + {"moretrees", "willow_trunk", 17}, +} + +if Horizontal_Trunks == true then -- see settings.txt +for i in pairs(TRuNKS) do + local MoD = TRuNKS[i][1] + local TRuNK = TRuNKS[i][2] + local NR = TRuNKS[i][3] + if minetest.get_modpath(MoD) ~= nil + and NR < 6 then -- moretrees trunks allready have facedir + + trunkname = MoD..":"..TRuNK + temptrunk = clone_node(trunkname) + temptrunk.paramtype2 = "facedir" + minetest.register_node(":"..trunkname, temptrunk) + end +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} + + local node_here = minetest.get_node(right_here) + local node_north = minetest.get_node(north) + local node_north2 = minetest.get_node(north2) + local node_south = minetest.get_node(south) + local node_south2 = minetest.get_node(south2) + local node_west = minetest.get_node(west) + local node_west2 = minetest.get_node(west2) + local node_east = minetest.get_node(east) + local node_east2 = minetest.get_node(east2) + if minetest.registered_nodes[node_here.name].buildable_to 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.add_node(right_here, {name=MoD..":"..TRuNK}) + else + minetest.add_node(right_here, {name="default:tree"}) + end + elseif trunk_type == 2 and Horizontal_Trunks == true then + if minetest.get_modpath(MoD) ~= nil then + if minetest.registered_nodes[node_north.name].buildable_to then + minetest.add_node(north, {name=MoD..":"..TRuNK, param2=4}) + end + + if length >= 4 and minetest.registered_nodes[node_north2.name].buildable_to then + minetest.add_node(north2, {name=MoD..":"..TRuNK, param2=4}) + end + + minetest.add_node(right_here, {name=MoD..":"..TRuNK, param2=4}) + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.add_node(south, {name=MoD..":"..TRuNK, param2=4}) + end + if length == 5 and minetest.registered_nodes[node_south2.name].buildable_to then + minetest.add_node(south2, {name=MoD..":"..TRuNK, param2=4}) + end + else + if minetest.registered_nodes[node_north.name].buildable_to then + minetest.add_node(north, {name="default:tree", param2=4}) + end + if length >= 4 and minetest.registered_nodes[node_north2.name].buildable_to then + minetest.add_node(north2, {name="default:tree", param2=4}) + end + minetest.add_node(right_here, {name="default:tree", param2=4}) + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.add_node(south, {name="default:tree", param2=4}) + end + if length == 5 and minetest.registered_nodes[node_south2.name].buildable_to then + minetest.add_node(south2, {name="default:tree", param2=4}) + end + end + elseif trunk_type == 3 and Horizontal_Trunks == true then + if minetest.get_modpath(MoD) ~= nil then + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.add_node(west, {name=MoD..":"..TRuNK, param2=12}) + end + if length >= 4 and minetest.registered_nodes[node_west2.name].buildable_to then + minetest.add_node(west2, {name=MoD..":"..TRuNK, param2=12}) + end + minetest.add_node(right_here, {name=MoD..":"..TRuNK, param2=12}) + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.add_node(east, {name=MoD..":"..TRuNK, param2=12}) + end + if length == 5 and minetest.registered_nodes[node_east2.name].buildable_to then + minetest.add_node(east2, {name=MoD..":"..TRuNK, param2=12}) + end + else + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.add_node(west, {name="default:tree", param2=12}) + end + if length >= 4 and minetest.registered_nodes[node_west2.name].buildable_to then + minetest.add_node(west2, {name="default:tree", param2=12}) + end + minetest.add_node(right_here, {name="default:tree", param2=12}) + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.add_node(east, {name="default:tree", param2=12}) + end + if length == 5 and minetest.registered_nodes[node_east2.name].buildable_to then + minetest.add_node(east2, {name="default:tree", param2=12}) + end + end + end + end + end + end +end + +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + max_count = Trunks_Max_Count, -- 320, + rarity = Trunks_Rarity, -- 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, + check_air = false, + }, + "abstract_trunks.place_trunk" +) + +----------------------------------------------------------------------------------------------- +-- MoSS & FuNGuS -- on ground +----------------------------------------------------------------------------------------------- +if Moss_on_ground == true then +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) + + if moss_type == 1 then + minetest.add_node(on_ground, {name="trunks:moss_fungus", param2=math.random(0,3)}) + else + minetest.add_node(on_ground, {name="trunks:moss", param2=math.random(0,3)}) + end + +end + +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + max_count = Moss_on_ground_Max_Count, + rarity = Moss_on_ground_Rarity, + 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" +) +end + +----------------------------------------------------------------------------------------------- +-- MoSS & FuNGuS -- on trunks +----------------------------------------------------------------------------------------------- +if Moss_on_trunk == true then +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} + local undrneath = {x=pos.x, y=pos.y-1, z=pos.z} + + local node_here = minetest.get_node(on_ground) + local node_north = minetest.get_node(at_side_n) + local node_east = minetest.get_node(at_side_e) + local node_south = minetest.get_node(at_side_s) + local node_west = minetest.get_node(at_side_w) + local node_under = minetest.get_node(undrneath) + + --if minetest.get_item_group(node_under.name, "tree") < 1 then + local moss_type = math.random(1,41) + if minetest.registered_nodes[node_here.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.add_node(on_ground, {name="trunks:moss_fungus", param2=math.random(0,3) --[[1]]}) + elseif moss_type < 22 then + minetest.add_node(on_ground, {name="trunks:moss", param2=math.random(0,3) --[[1]]}) + end + end + local moss_type = math.random(1,31) -- cliche of more moss at north + if minetest.registered_nodes[node_north.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.add_node(at_side_n, {name="trunks:moss_fungus", param2=math.random(4,7)}) -- 5,4,6,7 + elseif moss_type < 22 then + minetest.add_node(at_side_n, {name="trunks:moss", param2=math.random(4,7)}) + end + end + local moss_type = math.random(1,41) + if minetest.registered_nodes[node_east.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.add_node(at_side_e, {name="trunks:moss_fungus", param2=math.random(12,15)}) + elseif moss_type < 22 then + minetest.add_node(at_side_e, {name="trunks:moss", param2=math.random(12,15)}) + end + end + local moss_type = math.random(1,41) + if minetest.registered_nodes[node_south.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.add_node(at_side_s, {name="trunks:moss_fungus", param2=math.random(8,11)}) + elseif moss_type < 22 then + minetest.add_node(at_side_s, {name="trunks:moss", param2=math.random(8,11)}) + end + end + local moss_type = math.random(1,41) + if minetest.registered_nodes[node_west.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.add_node(at_side_w, {name="trunks:moss_fungus", param2=math.random(16,19)}) + elseif moss_type < 22 then + minetest.add_node(at_side_w, {name="trunks:moss", param2=math.random(16,19)}) + end + end + --end +end + +plantslib:register_generate_plant({ + surface = { + "default:tree", + "default:jungletree", + "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:pine_trunk", + "moretrees:rubber_tree_trunk", + "moretrees:rubber_tree_trunk_empty", + "moretrees:sequoia_trunk", + "moretrees:spruce_trunk", + "moretrees:willow_trunk", + "default:mossycobble" + }, + max_count = Moss_on_trunk_Max_Count, + rarity = Moss_on_trunk_Rarity, + min_elevation = 1, + max_elevation = 40, + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_trunks.grow_moss_on_trunk" +) +end + +----------------------------------------------------------------------------------------------- +-- RooTS +----------------------------------------------------------------------------------------------- +if Roots == true then -- see settings.txt + +abstract_trunks.grow_roots = function(pos) + local twig_size = math.random(1,27) + + 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) + local node_north = minetest.get_node(north) + local node_east = minetest.get_node(east) + local node_south = minetest.get_node(south) + local node_west = minetest.get_node(west) + + 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 minetest.registered_nodes[node_north.name].buildable_to then + minetest.add_node(north, {name="trunks:"..TRuNK.."root", param2=2}) + end + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.add_node(east, {name="trunks:"..TRuNK.."root", param2=3}) + end + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.add_node(south, {name="trunks:"..TRuNK.."root", param2=0}) + end + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.add_node(west, {name="trunks:"..TRuNK.."root", param2=1}) + end + end + end +end + +plantslib:register_generate_plant({ + 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" +) + +end diff --git a/trunks/init.lua b/trunks/init.lua new file mode 100644 index 0000000..ee9427d --- /dev/null +++ b/trunks/init.lua @@ -0,0 +1,17 @@ +----------------------------------------------------------------------------------------------- +local title = "Trunks" +local version = "0.1.4" +local mname = "trunks" +----------------------------------------------------------------------------------------------- +-- Code by Mossmanikin & Neuromancer + +abstract_trunks = {} + +dofile(minetest.get_modpath("trunks").."/trunks_settings.txt") +dofile(minetest.get_modpath("trunks").."/generating.lua") +dofile(minetest.get_modpath("trunks").."/nodes.lua") +dofile(minetest.get_modpath("trunks").."/crafting.lua") + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/trunks/nodes.lua b/trunks/nodes.lua new file mode 100644 index 0000000..b8b8624 --- /dev/null +++ b/trunks/nodes.lua @@ -0,0 +1,359 @@ +-- Code by Mossmanikin & Neuromancer +----------------------------------------------------------------------------------------------- +-- 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 = "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 + }, + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + sunlight_propagates = true, + buildable_to = true, + node_box = {type = "fixed", fixed = flat_stick}, + groups = { + dig_immediate=3, -- almost literally immediate, like just picking up + attached_node=1, + not_in_creative_inventory=iNV + }, + drop = "trunks:twig_1", + sounds = default.node_sound_leaves_defaults(), + liquids_pointable = true, + on_place = function(itemstack, placer, pointed_thing) + local pt = pointed_thing + local direction = minetest.dir_to_facedir(placer:get_look_dir()) + if minetest.get_node(pt.above).name=="air" then + minetest.set_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end + end, + }) +end + +----------------------------------------------------------------------------------------------- +-- MoSS +----------------------------------------------------------------------------------------------- +local flat_moss = {-1/2, -1/2, -1/2, 1/2, -15/32--[[<-flickers if smaller]], 1/2} + +minetest.register_node("trunks:moss", { + description = "Moss", + drawtype = "nodebox",--"signlike", + tiles = {"trunks_moss.png"}, + inventory_image = "trunks_moss.png", + wield_image = "trunks_moss.png", + paramtype = "light", + paramtype2 = "facedir",--"wallmounted", + sunlight_propagates = true, + walkable = false, + node_box = {type = "fixed", fixed = flat_moss}, + selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"}, + groups = {dig_immediate=2--[[,attached_node=1]]}, -- falling moss is too annoying + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- MoSS & FuNGuS +----------------------------------------------------------------------------------------------- +minetest.register_node("trunks:moss_fungus", { + description = "Moss & Fungus", + drawtype = "nodebox",--"signlike", + tiles = {"trunks_moss_fungus.png"}, + inventory_image = "trunks_moss_fungus.png", + wield_image = "trunks_moss_fungus.png", + paramtype = "light", + paramtype2 = "facedir",--"wallmounted", + sunlight_propagates = true, + walkable = false, + node_box = {type = "fixed", fixed = flat_moss}, + selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"}, + groups = {dig_immediate=2--[[,attached_node=1]]}, -- falling moss is too annoying + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS BLoCK +----------------------------------------------------------------------------------------------- +minetest.register_alias("woodstuff:twigs", "trunks:twigs") + +minetest.register_node("trunks:twigs", { + description = "Twigs Block", + paramtype2 = "facedir", + tiles = {"trunks_twigs.png"}, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS SLaB +----------------------------------------------------------------------------------------------- +minetest.register_alias("woodstuff:twigs_slab", "trunks:twigs_slab") + +minetest.register_node("trunks:twigs_slab", { + description = "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}, + sounds = default.node_sound_wood_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS RooF +----------------------------------------------------------------------------------------------- +minetest.register_alias("woodstuff:twigs_roof", "trunks:twigs_roof") + +minetest.register_node("trunks:twigs_roof", { + description = "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}, + 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 = "Twigs Roof Corner", + 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}, + 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 = "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}, + sounds = default.node_sound_wood_defaults(), +}) + +if Auto_Roof_Corner == true then + + 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.add_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.add_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.add_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.add_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.add_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.add_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.add_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.add_node(pos, {name=corner_2, param2=3}) + end + + 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 +----------------------------------------------------------------------------------------------- +if Roots == true then -- see settings.txt + +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" }, + + {"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", "pine_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 des = minetest.registered_nodes[MoD..":"..TRuNK].description + + minetest.register_node("trunks:"..TRuNK.."root", { + description = des.." Root", + 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" + }, + 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--, + --not_in_creative_inventory=1 -- atm in inv for testing + }, + --drop = "trunks:twig_1", -- not sure about this yet + sounds = default.node_sound_wood_defaults(), + }) + + end +end +end diff --git a/trunks/textures/credit_textures.txt b/trunks/textures/credit_textures.txt new file mode 100644 index 0000000..b3893d5 --- /dev/null +++ b/trunks/textures/credit_textures.txt @@ -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 +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/trunks/textures/old & unused/comboSticks.png b/trunks/textures/old & unused/comboSticks.png new file mode 100644 index 0000000..ca5eb14 Binary files /dev/null and b/trunks/textures/old & unused/comboSticks.png differ diff --git a/trunks/textures/old & unused/comboSticks_2.png b/trunks/textures/old & unused/comboSticks_2.png new file mode 100644 index 0000000..8dd954f Binary files /dev/null and b/trunks/textures/old & unused/comboSticks_2.png differ diff --git a/trunks/textures/old & unused/trunks_root_mask_old.png b/trunks/textures/old & unused/trunks_root_mask_old.png new file mode 100644 index 0000000..05544f4 Binary files /dev/null and b/trunks/textures/old & unused/trunks_root_mask_old.png differ diff --git a/trunks/textures/old & unused/trunks_twig_1e.png b/trunks/textures/old & unused/trunks_twig_1e.png new file mode 100644 index 0000000..e4bc9f5 Binary files /dev/null and b/trunks/textures/old & unused/trunks_twig_1e.png differ diff --git a/trunks/textures/old & unused/trunks_twig_1n.png b/trunks/textures/old & unused/trunks_twig_1n.png new file mode 100644 index 0000000..3389cd0 Binary files /dev/null and b/trunks/textures/old & unused/trunks_twig_1n.png differ diff --git a/trunks/textures/old & unused/trunks_twig_2n.png b/trunks/textures/old & unused/trunks_twig_2n.png new file mode 100644 index 0000000..11687dd Binary files /dev/null and b/trunks/textures/old & unused/trunks_twig_2n.png differ diff --git a/trunks/textures/old & unused/trunks_twig_3n.png b/trunks/textures/old & unused/trunks_twig_3n.png new file mode 100644 index 0000000..54c9dce Binary files /dev/null and b/trunks/textures/old & unused/trunks_twig_3n.png differ diff --git a/trunks/textures/old & unused/trunks_twig_4n.png b/trunks/textures/old & unused/trunks_twig_4n.png new file mode 100644 index 0000000..cc67ee6 Binary files /dev/null and b/trunks/textures/old & unused/trunks_twig_4n.png differ diff --git a/trunks/textures/old & unused/trunks_twig_5-8.png b/trunks/textures/old & unused/trunks_twig_5-8.png new file mode 100644 index 0000000..1bceec1 Binary files /dev/null and b/trunks/textures/old & unused/trunks_twig_5-8.png differ diff --git a/trunks/textures/old & unused/trunks_twig_9-12.png b/trunks/textures/old & unused/trunks_twig_9-12.png new file mode 100644 index 0000000..a86597b Binary files /dev/null and b/trunks/textures/old & unused/trunks_twig_9-12.png differ diff --git a/trunks/textures/trunks_moss.png b/trunks/textures/trunks_moss.png new file mode 100644 index 0000000..6ce1b62 Binary files /dev/null and b/trunks/textures/trunks_moss.png differ diff --git a/trunks/textures/trunks_moss_fungus.png b/trunks/textures/trunks_moss_fungus.png new file mode 100644 index 0000000..3b8788e Binary files /dev/null and b/trunks/textures/trunks_moss_fungus.png differ diff --git a/trunks/textures/trunks_root_mask.png b/trunks/textures/trunks_root_mask.png new file mode 100644 index 0000000..242bb8d Binary files /dev/null and b/trunks/textures/trunks_root_mask.png differ diff --git a/trunks/textures/trunks_twig_1.png b/trunks/textures/trunks_twig_1.png new file mode 100644 index 0000000..bebb38b Binary files /dev/null and b/trunks/textures/trunks_twig_1.png differ diff --git a/trunks/textures/trunks_twig_10.png b/trunks/textures/trunks_twig_10.png new file mode 100644 index 0000000..a345b29 Binary files /dev/null and b/trunks/textures/trunks_twig_10.png differ diff --git a/trunks/textures/trunks_twig_11.png b/trunks/textures/trunks_twig_11.png new file mode 100644 index 0000000..69bbfb0 Binary files /dev/null and b/trunks/textures/trunks_twig_11.png differ diff --git a/trunks/textures/trunks_twig_12.png b/trunks/textures/trunks_twig_12.png new file mode 100644 index 0000000..b7678d8 Binary files /dev/null and b/trunks/textures/trunks_twig_12.png differ diff --git a/trunks/textures/trunks_twig_13.png b/trunks/textures/trunks_twig_13.png new file mode 100644 index 0000000..bf13bf9 Binary files /dev/null and b/trunks/textures/trunks_twig_13.png differ diff --git a/trunks/textures/trunks_twig_2.png b/trunks/textures/trunks_twig_2.png new file mode 100644 index 0000000..f5c3a32 Binary files /dev/null and b/trunks/textures/trunks_twig_2.png differ diff --git a/trunks/textures/trunks_twig_3.png b/trunks/textures/trunks_twig_3.png new file mode 100644 index 0000000..752003e Binary files /dev/null and b/trunks/textures/trunks_twig_3.png differ diff --git a/trunks/textures/trunks_twig_4.png b/trunks/textures/trunks_twig_4.png new file mode 100644 index 0000000..5bd135a Binary files /dev/null and b/trunks/textures/trunks_twig_4.png differ diff --git a/trunks/textures/trunks_twig_5.png b/trunks/textures/trunks_twig_5.png new file mode 100644 index 0000000..79a57f9 Binary files /dev/null and b/trunks/textures/trunks_twig_5.png differ diff --git a/trunks/textures/trunks_twig_6.png b/trunks/textures/trunks_twig_6.png new file mode 100644 index 0000000..c682453 Binary files /dev/null and b/trunks/textures/trunks_twig_6.png differ diff --git a/trunks/textures/trunks_twig_7.png b/trunks/textures/trunks_twig_7.png new file mode 100644 index 0000000..a37b9b3 Binary files /dev/null and b/trunks/textures/trunks_twig_7.png differ diff --git a/trunks/textures/trunks_twig_8.png b/trunks/textures/trunks_twig_8.png new file mode 100644 index 0000000..b411187 Binary files /dev/null and b/trunks/textures/trunks_twig_8.png differ diff --git a/trunks/textures/trunks_twig_9.png b/trunks/textures/trunks_twig_9.png new file mode 100644 index 0000000..176812a Binary files /dev/null and b/trunks/textures/trunks_twig_9.png differ diff --git a/trunks/textures/trunks_twigs.png b/trunks/textures/trunks_twigs.png new file mode 100644 index 0000000..20ae6ca Binary files /dev/null and b/trunks/textures/trunks_twigs.png differ diff --git a/trunks/textures/trunks_twigs_corner.png b/trunks/textures/trunks_twigs_corner.png new file mode 100644 index 0000000..a1ebde7 Binary files /dev/null and b/trunks/textures/trunks_twigs_corner.png differ diff --git a/trunks/textures/trunks_twigs_top.png b/trunks/textures/trunks_twigs_top.png new file mode 100644 index 0000000..828768a Binary files /dev/null and b/trunks/textures/trunks_twigs_top.png differ diff --git a/trunks/trunks_settings.txt b/trunks/trunks_settings.txt new file mode 100644 index 0000000..7fe8822 --- /dev/null +++ b/trunks/trunks_settings.txt @@ -0,0 +1,70 @@ +-- Settings for generation of stuff (at map-generation time) + + + + + +Horizontal_Trunks = true + + + +Trunks_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes + + +Trunks_Rarity = 99 -- larger values make trunks more rare (100 means chance of 0 %) + + + + + +Big_Twigs = true -- twigs larger than one node +Twigs_on_ground = true + + + +Twigs_on_ground_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes + +Twigs_on_ground_Rarity = 66 -- larger values make twigs more rare (100 means chance of 0 %) + + + + + +Twigs_on_water = true + + + +Twigs_on_water_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes + + +Twigs_on_water_Rarity = 33 -- larger values make twigs more rare (100 means chance of 0 %) + + + + + +Moss_on_ground = true + + + +Moss_on_ground_Max_Count = 400 -- absolute maximum number in an area of 80x80x80 nodes + +Moss_on_ground_Rarity = 79 -- larger values makes moss more rare (100 means chance of 0 %) + + + + + +Moss_on_trunk = true + + + +Moss_on_trunk_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes + +Moss_on_trunk_Rarity = 24 -- larger values makes moss more rare (100 means chance of 0 %) + + +Auto_Roof_Corner = true -- behavior is similar (not the same!) to the one of minecraft stairs + + +Roots = true \ No newline at end of file diff --git a/woodsoils/depends.txt b/woodsoils/depends.txt new file mode 100644 index 0000000..462d183 --- /dev/null +++ b/woodsoils/depends.txt @@ -0,0 +1,7 @@ +default +plants_lib +bushes? +ferns? +moretrees? +trees? +trunks? \ No newline at end of file diff --git a/woodsoils/generating.lua b/woodsoils/generating.lua new file mode 100644 index 0000000..34b145c --- /dev/null +++ b/woodsoils/generating.lua @@ -0,0 +1,152 @@ +-- generating of forest soils + +local RaDiuS = { +-- WE1 NS1 WE2 NS2 WE3 NS3 + {-1,-2, -2,-2, -2,-3}, + { 0,-2, -3,-1, -3,-2}, + { 1,-2, -3, 0, -4,-1}, + {-2,-1, -3, 1, -4, 0}, + {-1,-1, -2, 2, -4, 1}, + { 0,-1, -1, 3, -3, 2}, + { 1,-1, 0, 3, -2, 3}, + { 2,-1, 1, 3, -1, 4}, + {-2, 0, 2, 2, 0, 4}, + {-1, 0, 3, 1, 1, 4}, + { 0, 0, 3, 0, 2, 3}, + { 1, 0, 3,-1, 3, 2}, + { 2, 0, 2,-2, 4, 1}, + {-2, 1, 1,-3, 4, 0}, + {-1, 1, 0,-3, 4,-1}, + { 0, 1, -1,-3, 3,-2}, + { 1, 1, 0, 0, 2,-3}, + { 2, 1, 0, 0, 1,-4}, + {-1, 2, 0, 0, 0,-4}, + { 0, 2, 0, 0, -1,-4}, + { 1, 2, 0, 0, 0, 0}, +} +-- e = + , n = + +abstract_woodsoils.place_soil = function(pos) + + if minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name, "soil") > 0 + or minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z}).name, "soil") > 0 then + for i in pairs(RaDiuS) do + local WE1 = RaDiuS[i][1] + local NS1 = RaDiuS[i][2] + local WE2 = RaDiuS[i][3] + local NS2 = RaDiuS[i][4] + local WE3 = RaDiuS[i][5] + local NS3 = RaDiuS[i][6] + local radius_1a = {x=pos.x+WE1,y=pos.y-1,z=pos.z+NS1} + local radius_1b = {x=pos.x+WE1,y=pos.y-2,z=pos.z+NS1} + local radius_2a = {x=pos.x+WE2,y=pos.y-1,z=pos.z+NS2} + local radius_2b = {x=pos.x+WE2,y=pos.y-2,z=pos.z+NS2} + local radius_3a = {x=pos.x+WE3,y=pos.y-1,z=pos.z+NS3} + local radius_3b = {x=pos.x+WE3,y=pos.y-2,z=pos.z+NS3} + --local node_1a = minetest.get_node(radius_1a) + --local node_1b = minetest.get_node(radius_1b) + local node_2a = minetest.get_node(radius_2a) + local node_2b = minetest.get_node(radius_2b) + local node_3a = minetest.get_node(radius_3a) + local node_3b = minetest.get_node(radius_3b) + -- Dirt with Leaves 1 + if minetest.get_item_group(minetest.get_node(radius_1a).name, "soil") > 0 then + minetest.add_node(radius_1a, {name="woodsoils:dirt_with_leaves_1"}) + end + if minetest.get_item_group(minetest.get_node(radius_1b).name, "soil") > 0 then + minetest.add_node(radius_1b, {name="woodsoils:dirt_with_leaves_1"}) + end + -- Grass with Leaves 2 + if string.find(node_2a.name, "dirt_with_grass") then + minetest.add_node(radius_2a, {name="woodsoils:grass_with_leaves_2"}) + end + if string.find(node_2b.name, "dirt_with_grass") then + minetest.add_node(radius_2b, {name="woodsoils:grass_with_leaves_2"}) + end + -- Grass with Leaves 1 + if string.find(node_3a.name, "dirt_with_grass") then + minetest.add_node(radius_3a, {name="woodsoils:grass_with_leaves_1"}) + end + if string.find(node_3b.name, "dirt_with_grass") then + minetest.add_node(radius_3b, {name="woodsoils:grass_with_leaves_1"}) + end + end + end +end + +plantslib:register_generate_plant({ + surface = { + "group:tree", + "ferns:fern_03", + "ferns:fern_02", + "ferns:fern_01" + }, + max_count = 1000, + rarity = 1, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"group:tree","ferns:fern_03","ferns:fern_02","ferns:fern_01"}, + near_nodes_size = 5, + near_nodes_vertical = 1, + near_nodes_count = 4, + plantlife_limit = -1, + check_air = false, + }, + "abstract_woodsoils.place_soil" +) + +plantslib:register_generate_plant({ + surface = { + "moretrees:apple_tree_sapling_ongen", + "moretrees:beech_sapling_ongen", + "moretrees:birch_sapling_ongen", + "moretrees:fir_sapling_ongen", + "moretrees:jungletree_sapling_ongen", + "moretrees:oak_sapling_ongen", + "moretrees:palm_sapling_ongen", + "moretrees:pine_sapling_ongen", + "moretrees:rubber_tree_sapling_ongen", + "moretrees:sequoia_sapling_ongen", + "moretrees:spruce_sapling_ongen", + "moretrees:willow_sapling_ongen" + }, + max_count = 1000, + rarity = 2, + min_elevation = 1, + max_elevation = 40, + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_woodsoils.place_soil" +) + +minetest.register_abm({ + nodenames = {"default:papyrus"}, + neighbors = { + "woodsoils:dirt_with_leaves_1", + "woodsoils:dirt_with_leaves_2", + "woodsoils:grass_with_leaves_1", + "woodsoils:grass_with_leaves_2" + }, + interval = 50, + chance = 20, + action = function(pos, node) + pos.y = pos.y-1 + local name = minetest.get_node(pos).name + if string.find(name, "_with_leaves_") then + if minetest.find_node_near(pos, 3, {"group:water"}) == nil then + return + end + pos.y = pos.y+1 + local height = 0 + while minetest.get_node(pos).name == "default:papyrus" and height < 4 do + height = height+1 + pos.y = pos.y+1 + end + if height < 4 then + if minetest.get_node(pos).name == "air" then + minetest.set_node(pos, {name="default:papyrus"}) + end + end + end + end, +}) diff --git a/woodsoils/init.lua b/woodsoils/init.lua new file mode 100644 index 0000000..9037d45 --- /dev/null +++ b/woodsoils/init.lua @@ -0,0 +1,29 @@ +----------------------------------------------------------------------------------------------- +local title = "Wood Soils" -- former "Forest Soils" +local version = "0.0.9" +local mname = "woodsoils" -- former "forestsoils" +----------------------------------------------------------------------------------------------- + +abstract_woodsoils = {} + +dofile(minetest.get_modpath("woodsoils").."/nodes.lua") +dofile(minetest.get_modpath("woodsoils").."/generating.lua") + +-- felt like playing a bit :D +--[[print(" _____ __") +print("_/ ____\\___________ ____ _______/ |_") +print("\\ __\\/ _ \\_ __ \\_/ __ \\ / ___/\\ __\\") +print(" | | ( <_> ) | \\/\\ ___/ \\___ \\ | |") +print(" |__| \\____/|__| \\___ >____ > |__|") +print(" \\/ \\/") + +print(" .__.__") +print(" __________ |__| | ______") +print(" / ___/ _ \\| | | / ___/") +print(" \\___ ( <_> ) | |__\\___ \\") +print("/____ >____/|__|____/____ >") +print(" \\/ \\/")]] + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/woodsoils/nodes.lua b/woodsoils/nodes.lua new file mode 100644 index 0000000..e4aeb1d --- /dev/null +++ b/woodsoils/nodes.lua @@ -0,0 +1,79 @@ +-- nodes + +minetest.register_node("woodsoils:dirt_with_leaves_1", { + description = "Forrest Soil 1", + tiles = { + "default_dirt.png^woodsoils_ground_cover.png", + "default_dirt.png", + "default_dirt.png^woodsoils_ground_cover_side.png"}, + is_ground_content = true, + groups = { + crumbly=3, + soil=1--, + --not_in_creative_inventory=1 + }, + --drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +minetest.register_node("woodsoils:dirt_with_leaves_2", { + description = "Forrest Soil 2", + tiles = { + "woodsoils_ground.png", + "default_dirt.png", + "default_dirt.png^woodsoils_ground_side.png"}, + is_ground_content = true, + groups = { + crumbly=3, + soil=1--, + --not_in_creative_inventory=1 + }, + --drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +minetest.register_node("woodsoils:grass_with_leaves_1", { + description = "Forrest Soil 3", + tiles = { + "default_grass.png^woodsoils_ground_cover2.png", + "default_dirt.png", + "default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side2.png"}, + is_ground_content = true, + groups = { + crumbly=3, + soil=1--, + --not_in_creative_inventory=1 + }, + --drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +minetest.register_node("woodsoils:grass_with_leaves_2", { + description = "Forrest Soil 4", + tiles = { + "default_grass.png^woodsoils_ground_cover.png", + "default_dirt.png", + "default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side.png"}, + is_ground_content = true, + groups = { + crumbly=3, + soil=1--, + --not_in_creative_inventory=1 + }, + --drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +-- For compatibility with older stuff +minetest.register_alias("forestsoils:dirt_with_leaves_1", "woodsoils:dirt_with_leaves_1") +minetest.register_alias("forestsoils:dirt_with_leaves_2", "woodsoils:dirt_with_leaves_2") +minetest.register_alias("forestsoils:grass_with_leaves_1", "woodsoils:grass_with_leaves_1") +minetest.register_alias("forestsoils:grass_with_leaves_2", "woodsoils:grass_with_leaves_2") \ No newline at end of file diff --git a/woodsoils/textures/credit_textures.txt b/woodsoils/textures/credit_textures.txt new file mode 100644 index 0000000..45d582d --- /dev/null +++ b/woodsoils/textures/credit_textures.txt @@ -0,0 +1,16 @@ +------------------------------------------------------------- +Credit for textures of "woodsoils" +------------------------------------------------------------- +(If more than one author is listed the names are in alphabetical order) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +FOLDER TEXTURE AUTHORS +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../woodsoils/textures woodsoils_ground.png Mossmanikin + woodsoils_ground_cover.png Mossmanikin + woodsoils_ground_cover_side.png Mossmanikin + woodsoils_ground_cover_side2.png Mossmanikin + woodsoils_ground_cover2.png Mossmanikin + woodsoils_ground_side.png Mossmanikin +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../woodsoils/textures/not in use woodsoils.png Mossmanikin +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/woodsoils/textures/not in use/woodsoils.png b/woodsoils/textures/not in use/woodsoils.png new file mode 100644 index 0000000..fd196b8 Binary files /dev/null and b/woodsoils/textures/not in use/woodsoils.png differ diff --git a/woodsoils/textures/woodsoils_ground.png b/woodsoils/textures/woodsoils_ground.png new file mode 100644 index 0000000..9001b2e Binary files /dev/null and b/woodsoils/textures/woodsoils_ground.png differ diff --git a/woodsoils/textures/woodsoils_ground_cover.png b/woodsoils/textures/woodsoils_ground_cover.png new file mode 100644 index 0000000..1168adc Binary files /dev/null and b/woodsoils/textures/woodsoils_ground_cover.png differ diff --git a/woodsoils/textures/woodsoils_ground_cover2.png b/woodsoils/textures/woodsoils_ground_cover2.png new file mode 100644 index 0000000..bb3dda2 Binary files /dev/null and b/woodsoils/textures/woodsoils_ground_cover2.png differ diff --git a/woodsoils/textures/woodsoils_ground_cover_side.png b/woodsoils/textures/woodsoils_ground_cover_side.png new file mode 100644 index 0000000..ac1393b Binary files /dev/null and b/woodsoils/textures/woodsoils_ground_cover_side.png differ diff --git a/woodsoils/textures/woodsoils_ground_cover_side2.png b/woodsoils/textures/woodsoils_ground_cover_side2.png new file mode 100644 index 0000000..acea830 Binary files /dev/null and b/woodsoils/textures/woodsoils_ground_cover_side2.png differ diff --git a/woodsoils/textures/woodsoils_ground_side.png b/woodsoils/textures/woodsoils_ground_side.png new file mode 100644 index 0000000..fbca9d6 Binary files /dev/null and b/woodsoils/textures/woodsoils_ground_side.png differ diff --git a/youngtrees/depends.txt b/youngtrees/depends.txt new file mode 100644 index 0000000..bde0bdf --- /dev/null +++ b/youngtrees/depends.txt @@ -0,0 +1,2 @@ +default +plants_lib \ No newline at end of file diff --git a/youngtrees/init.lua b/youngtrees/init.lua new file mode 100644 index 0000000..4153cc8 --- /dev/null +++ b/youngtrees/init.lua @@ -0,0 +1,150 @@ + abstract_youngtrees = {} + + + + +minetest.register_node("youngtrees:bamboo", { + description = "youngtreeBamboo", + drawtype="nodebox", + tiles = {"bamboo.png"}, + inventory_image = "bamboo.png", + wield_image = "bamboo.png", +paramtype = "light", + walkable = false, + is_ground_content = true, +node_box = { + type = "fixed", + fixed = { + {-0.058251,-0.500000,-0.413681,0.066749,0.500000,-0.282500}, --NodeBox 1 + {-0.058251,-0.500000,-0.103123,0.066749,0.500000,0.038672}, --NodeBox 2 + {-0.058251,-0.500000,0.181227,0.066749,0.500000,0.342500}, --NodeBox 3 + } +}, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + + + + +minetest.register_node("youngtrees:youngtree2_middle",{ + description = "youngtree2Middle", + drawtype="nodebox", + tiles = {"youngtree2branch.png"}, + inventory_image = "youngtree2branch.png", + wield_image = "youngtree2branch.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + node_box = { + type = "fixed", + fixed = { + {0.125000,-0.500000,-0.500000,0.500000,-0.187500,-0.125000}, --NodeBox 1 + {-0.187500,-0.187500,-0.500000,0.500000,0.125000,0.250000}, --NodeBox 2 + {-0.500000,0.125000,-0.500000,0.500000,0.500000,0.500000}, --NodeBox 3 + } + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("youngtrees:youngtree_top", { + description = "youngtreeTop", + drawtype = "plantlike", + tiles = {"youngtree16xa.png"}, + inventory_image = "youngtree16xa.png", + wield_image = "youngtree16xa.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + + +minetest.register_node("youngtrees:youngtree_middle", { + description = "youngtreeMiddle", + drawtype = "plantlike", + tiles = {"youngtree16xb.png"}, + inventory_image = "youngtree16xb.png", + wield_image = "youngtree16xb.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + + + +minetest.register_node("youngtrees:youngtree_bottom", { + description = "youngtreeBottom", + drawtype = "plantlike", + tiles = {"youngtree16xc.png"}, + inventory_image = "youngtree16xc.png", + wield_image = "youngtree16xc.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + + + abstract_youngtrees.grow_youngtree = function(pos) + local height = math.random(1,3) + abstract_youngtrees.grow_youngtree_node(pos,height) +end + +abstract_youngtrees.grow_youngtree_node = function(pos, height) + + + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} + + if minetest.get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.get_node(right_here).name == "default:junglegrass" then + if height == 1 then + minetest.add_node(right_here, {name="youngtrees:youngtree_top"}) + end + if height == 2 then + minetest.add_node(right_here, {name="youngtrees:youngtree_bottom"}) + minetest.add_node(above_right_here, {name="youngtrees:youngtree_top"}) + end + if height == 3 then + local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z} + minetest.add_node(right_here, {name="youngtrees:youngtree_bottom"}) + minetest.add_node(above_right_here, {name="youngtrees:youngtree_middle"}) + minetest.add_node(two_above_right_here, {name="youngtrees:youngtree_top"}) + end + end +end + + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = 55, --10,15 + rarity = 101 - 4, --3,4 + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_youngtrees.grow_youngtree" +) diff --git a/youngtrees/textures/bamboo.png b/youngtrees/textures/bamboo.png new file mode 100644 index 0000000..c5c42a9 Binary files /dev/null and b/youngtrees/textures/bamboo.png differ diff --git a/youngtrees/textures/unused/sapling.png b/youngtrees/textures/unused/sapling.png new file mode 100644 index 0000000..fd2e331 Binary files /dev/null and b/youngtrees/textures/unused/sapling.png differ diff --git a/youngtrees/textures/unused/sapling16x.png b/youngtrees/textures/unused/sapling16x.png new file mode 100644 index 0000000..a8c2a77 Binary files /dev/null and b/youngtrees/textures/unused/sapling16x.png differ diff --git a/youngtrees/textures/youngtree16xa.png b/youngtrees/textures/youngtree16xa.png new file mode 100644 index 0000000..cea22f1 Binary files /dev/null and b/youngtrees/textures/youngtree16xa.png differ diff --git a/youngtrees/textures/youngtree16xb.png b/youngtrees/textures/youngtree16xb.png new file mode 100644 index 0000000..36c3bd7 Binary files /dev/null and b/youngtrees/textures/youngtree16xb.png differ diff --git a/youngtrees/textures/youngtree16xc.png b/youngtrees/textures/youngtree16xc.png new file mode 100644 index 0000000..a0e2cd9 Binary files /dev/null and b/youngtrees/textures/youngtree16xc.png differ diff --git a/youngtrees/textures/youngtree2branch.png b/youngtrees/textures/youngtree2branch.png new file mode 100644 index 0000000..ce7e310 Binary files /dev/null and b/youngtrees/textures/youngtree2branch.png differ