diff --git a/bushes/2high_init.lua b/bushes/2high_init.lua new file mode 100644 index 0000000..47032ba --- /dev/null +++ b/bushes/2high_init.lua @@ -0,0 +1,149 @@ + abstract_bushes = {} + + minetest.register_node("bushes:bushbranches1", { + description = "bushbranches1", + drawtype = "nodebox", + tiles = { + "blank.png", + "BushBranches1sm5.png", + "BushBranches1sm5.png", + "BushBranches1sm5.png", + "BushBranches1sm5.png", + "blank.png" + }, + node_box = { + type = "fixed", + fixed = { +-- {left,bottom,front,right,top,back} + {0, -1/2, -1/2, 0, 1/2, 1/2}, + {-1/2, -1/2, 0, 1/2, 1/2, 0} + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "BlockBranch1Rsm.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {tree=1, snappy=3, flammable=2, leaves=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + + + +minetest.register_node("bushes:bushbranches2", { + description = "bushbranches2", + drawtype = "nodebox", + tiles = { + "blank.png", + "BlockBranch1Lsm.png", + "BlockBranch1Lsm.png", + "BlockBranch1Rsm.png", + "BlockBranch1Rsm.png", + "blank.png" + }, + node_box = { + type = "fixed", + fixed = { +-- {left,bottom,front,right,top,back} + {0, -1/2, -1/2, 0, 1/2, 1/2}, + {-1/2, -1/2, 0, 1/2, 1/2, 0} + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "BlockBranch1Rsm.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {tree=1, snappy=3, flammable=2, leaves=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + minetest.register_node("bushes:bushbranches3", { + description = "bushbranches3", + drawtype = "nodebox", + tiles = { + "blank.png", + "BlockBranch1Rsm.png", + "BlockBranch1Rsm.png", + "BlockBranch1Lsm.png", + "BlockBranch1Lsm.png", + "blank.png" + }, + node_box = { + type = "fixed", + fixed = { +-- {left,bottom,front,right,top,back} + {0, -1/2, -1/2, 0, 1/2, 1/2}, + {-1/2, -1/2, 0, 1/2, 1/2, 0} + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "BlockBranch1Rsm.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {tree=1, snappy=3, flammable=2, leaves=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + minetest.register_node("bushes:BushLeaves", { + description = "BushLeaves", + tiles = { + "moretrees_sequoia_leaves.png" }, + inventory_image = "moretrees_sequoia_leaves.png", + --is_ground_content = true, + paramtype = "light", + paramtype2 = "facedir", + groups = { snappy=3, + flammable=2, + attached_node=1}, + sounds = default.node_sound_stone_defaults(), +}) + +abstract_bushes.grow_bush = function(pos) + 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) + 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}) + minetest.add_node(above_right_here, {name="bushes:BushLeaves"}) + 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.add_node(two_above_right_here, {name="bushes:BushLeaves"}) + end + end +end + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = 10, + rarity = 101 - 3, + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_bushes.grow_bush" +) + + --http://dev.minetest.net/Node_Drawtypes + + + \ No newline at end of file diff --git a/bushes/Mod1init.lua b/bushes/Mod1init.lua new file mode 100644 index 0000000..e4c9861 --- /dev/null +++ b/bushes/Mod1init.lua @@ -0,0 +1,184 @@ + abstract_bushes = {} + + minetest.register_node("bushes:bushbranches1", { + description = "bushbranches1", + drawtype = "nodebox", + tiles = { + "blank.png", + "BushBranches1sm5.png", + "BushBranches1sm5.png", + "BushBranches1sm5.png", + "BushBranches1sm5.png", + "blank.png" + }, + node_box = { + type = "fixed", + fixed = { +-- {left,bottom,front,right,top,back} + {0, -1/2, -1/2, 0, 1/2, 1/2}, + {-1/2, -1/2, 0, 1/2, 1/2, 0} + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "BlockBranch1Rsm.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {tree=1, snappy=3, flammable=2, leaves=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + + + +minetest.register_node("bushes:bushbranches2", { + description = "bushbranches2", + drawtype = "nodebox", + tiles = { + "blank.png", + "BlockBranch1Lsm.png", + "BlockBranch1Lsm.png", + "BlockBranch1Rsm.png", + "BlockBranch1Rsm.png", + "blank.png" + }, + node_box = { + type = "fixed", + fixed = { +-- {left,bottom,front,right,top,back} + {0, -1/2, -1/2, 0, 1/2, 1/2}, + {-1/2, -1/2, 0, 1/2, 1/2, 0} + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "BlockBranch1Rsm.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {tree=1, snappy=3, flammable=2, leaves=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + minetest.register_node("bushes:bushbranches3", { + description = "bushbranches3", + drawtype = "nodebox", + tiles = { + "blank.png", + "BlockBranch1Rsm.png", + "BlockBranch1Rsm.png", + "BlockBranch1Lsm.png", + "BlockBranch1Lsm.png", + "blank.png" + }, + node_box = { + type = "fixed", + fixed = { +-- {left,bottom,front,right,top,back} + {0, -1/2, -1/2, 0, 1/2, 1/2}, + {-1/2, -1/2, 0, 1/2, 1/2, 0} + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "BlockBranch1Rsm.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {tree=1, snappy=3, flammable=2, leaves=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + minetest.register_node("bushes:BushLeaves", { + description = "BushLeaves", + tiles = { + "moretrees_sequoia_leaves.png" }, + inventory_image = "moretrees_sequoia_leaves.png", + --is_ground_content = true, + paramtype = "light", + paramtype2 = "facedir", + groups = { snappy=3, + flammable=2, + attached_node=1}, + sounds = default.node_sound_stone_defaults(), +}) + +abstract_bushes.grow_bush = function(pos) +-- 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) +-- 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}) +-- minetest.add_node(above_right_here, {name="bushes:BushLeaves"}) +-- 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.add_node(two_above_right_here, {name="bushes:BushLeaves"}) +-- end +-- end + 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+1, z=pos.z} + abstract_bushes.grow_bush_node(right_pos) + end + local chance_of_bush_node_left = math.random(1,10) + if chance_of_bush_node_left> 5 then + local left_pos = {x=pos.x-1, y=pos.y+1, z=pos.z} + abstract_bushes.grow_bush_node(left_pos) + end + local chance_of_bush_node_front = math.random(1,10) + if chance_of_bush_node_front> 5 then + local front_pos = {x=pos.x, y=pos.y+1, z=pos.z+1} + abstract_bushes.grow_bush_node(front_pos) + end +abstract_bushes.grow_bush_node(pos) +end + +abstract_bushes.grow_bush_node = function(pos) + 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) + 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}) + minetest.add_node(above_right_here, {name="bushes:BushLeaves"}) + 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.add_node(two_above_right_here, {name="bushes:BushLeaves"}) + end + end +end + + + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = 10, + rarity = 101 - 3, + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_bushes.grow_bush" +) + + --http://dev.minetest.net/Node_Drawtypes + + + \ No newline at end of file diff --git a/bushes/bak.init.lua b/bushes/bak.init.lua new file mode 100644 index 0000000..8851d0a --- /dev/null +++ b/bushes/bak.init.lua @@ -0,0 +1,82 @@ +minetest.register_node("bushes:bushbranches", { + description = "BushBranches", + drawtype = "plantlike", + paramtype = "light", + tiles = {"BushBranches1sm5.png"}, + inventory_image = "BushBranches1sm5.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} + }, +}) + + +minetest.register_node("bushes:bushbranches2", { + description = "BushBranches2", + drawtype = "plantlike", + paramtype = "light", + tiles = {"BlockBranch1Rsm.png"}, + inventory_image = "BlockBranch1Rsm.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} + }, +}) + + minetest.register_node("bushes:bushbranches3", { + description = "BushBranches3", + drawtype = "plantlike", + paramtype = "light", + tiles = {"BlockBranch1Lsm.png"}, + inventory_image = "BlockBranch1Lsm.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} + }, +}) + +minetest.register_node("bushes:BushLeaves", { + description = "BushLeaves", + tiles = { + "moretrees_sequoia_leaves.png" }, + inventory_image = "moretrees_sequoia_leaves.png", + --is_ground_content = true, + paramtype = "light", + paramtype2 = "facedir", + groups = { snappy=3, + flammable=2, + attached_node=1}, + sounds = default.node_sound_stone_defaults(), +}) + + + + + + + + --http://dev.minetest.net/Node_Drawtypes + + + \ No newline at end of file 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..6b51611 --- /dev/null +++ b/bushes/init.lua @@ -0,0 +1,186 @@ +-- 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:bushbranches1", { + description = "bushbranches1", + drawtype = "nodebox", + tiles = { + "blank.png", + "BushBranches1sm5.png", + "BushBranches1sm5.png", + "BushBranches1sm5.png", + "BushBranches1sm5.png", + "blank.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 = "BlockBranch1Rsm.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {tree=1, snappy=3, flammable=2, leaves=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + + + +minetest.register_node("bushes:bushbranches2", { + description = "bushbranches2", + drawtype = "nodebox", + tiles = { + "blank.png", + "BlockBranch1Lsm.png", + "BlockBranch1Lsm.png", + "BlockBranch1Rsm.png", + "BlockBranch1Rsm.png", + "blank.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 = "BlockBranch1Rsm.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {tree=1, snappy=3, flammable=2, leaves=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + minetest.register_node("bushes:bushbranches3", { + description = "bushbranches3", + drawtype = "nodebox", + tiles = { + "blank.png", + "BlockBranch1Rsm.png", + "BlockBranch1Rsm.png", + "BlockBranch1Lsm.png", + "BlockBranch1Lsm.png", + "blank.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 = "BlockBranch1Rsm.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = {tree=1, snappy=3, flammable=2, leaves=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + minetest.register_node("bushes:BushLeaves", { + description = "BushLeaves", + tiles = { + "moretrees_sequoia_leaves.png" }, + inventory_image = "moretrees_sequoia_leaves.png", + --is_ground_content = true, + paramtype = "light", + paramtype2 = "facedir", + groups = { snappy=3, + flammable=2, + attached_node=1}, + sounds = default.node_sound_stone_defaults(), +}) + +abstract_bushes.grow_bush = function(pos) + local chance_of_bush_node_right = math.random(1,10) + if chance_of_bush_node_right> 8 then + local right_pos = {x=pos.x+1, y=pos.y+1, z=pos.z} + abstract_bushes.grow_bush_node(right_pos,3) + end + local chance_of_bush_node_left = math.random(1,10) + if chance_of_bush_node_left> 8 then + local left_pos = {x=pos.x-1, y=pos.y+1, z=pos.z} + abstract_bushes.grow_bush_node(left_pos,1) + end + local chance_of_bush_node_front = math.random(1,10) + if chance_of_bush_node_front> 8 then + local front_pos = {x=pos.x, y=pos.y+1, z=pos.z+1} + abstract_bushes.grow_bush_node(front_pos,2) + end + local chance_of_bush_node_back = math.random(1,10) + if chance_of_bush_node_back> 8 then + local back_pos = {x=pos.x, y=pos.y+1, z=pos.z-1} + abstract_bushes.grow_bush_node(back_pos,0) + end + +abstract_bushes.grow_bush_node(pos,5) +end + +abstract_bushes.grow_bush_node = function(pos,dir) + 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 + if dir == 5 then + bush_branch_type = 1 + 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.add_node(above_right_here, {name="bushes:BushLeaves"}) + 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.add_node(two_above_right_here, {name="bushes:BushLeaves"}) + 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" +) + + --http://dev.minetest.net/Node_Drawtypes + + + \ No newline at end of file diff --git a/bushes/textures/BlockBranch1.png b/bushes/textures/BlockBranch1.png new file mode 100644 index 0000000..c3ba887 Binary files /dev/null and b/bushes/textures/BlockBranch1.png differ diff --git a/bushes/textures/BlockBranch1L.png b/bushes/textures/BlockBranch1L.png new file mode 100644 index 0000000..08fbb66 Binary files /dev/null and b/bushes/textures/BlockBranch1L.png differ diff --git a/bushes/textures/BlockBranch1Lsm.png b/bushes/textures/BlockBranch1Lsm.png new file mode 100644 index 0000000..8d3070f Binary files /dev/null and b/bushes/textures/BlockBranch1Lsm.png differ diff --git a/bushes/textures/BlockBranch1R.png b/bushes/textures/BlockBranch1R.png new file mode 100644 index 0000000..58b9214 Binary files /dev/null and b/bushes/textures/BlockBranch1R.png differ diff --git a/bushes/textures/BlockBranch1Rsm.png b/bushes/textures/BlockBranch1Rsm.png new file mode 100644 index 0000000..3499372 Binary files /dev/null and b/bushes/textures/BlockBranch1Rsm.png differ diff --git a/bushes/textures/BushBranches1.png b/bushes/textures/BushBranches1.png new file mode 100644 index 0000000..c02b7ab Binary files /dev/null and b/bushes/textures/BushBranches1.png differ diff --git a/bushes/textures/BushBranches1sm.png b/bushes/textures/BushBranches1sm.png new file mode 100644 index 0000000..2ab7ca3 Binary files /dev/null and b/bushes/textures/BushBranches1sm.png differ diff --git a/bushes/textures/BushBranches1sm2.png b/bushes/textures/BushBranches1sm2.png new file mode 100644 index 0000000..81005e1 Binary files /dev/null and b/bushes/textures/BushBranches1sm2.png differ diff --git a/bushes/textures/BushBranches1sm3.png b/bushes/textures/BushBranches1sm3.png new file mode 100644 index 0000000..c626a1f Binary files /dev/null and b/bushes/textures/BushBranches1sm3.png differ diff --git a/bushes/textures/BushBranches1sm4.png b/bushes/textures/BushBranches1sm4.png new file mode 100644 index 0000000..146ff08 Binary files /dev/null and b/bushes/textures/BushBranches1sm4.png differ diff --git a/bushes/textures/BushBranches1sm5.png b/bushes/textures/BushBranches1sm5.png new file mode 100644 index 0000000..cf6f00a Binary files /dev/null and b/bushes/textures/BushBranches1sm5.png differ diff --git a/bushes/textures/blank.png b/bushes/textures/blank.png new file mode 100644 index 0000000..06776a0 Binary files /dev/null and b/bushes/textures/blank.png differ diff --git a/bushes/textures/moretrees_sequoia_leaves.png b/bushes/textures/moretrees_sequoia_leaves.png new file mode 100644 index 0000000..d0bc984 Binary files /dev/null and b/bushes/textures/moretrees_sequoia_leaves.png differ