diff --git a/bushes/init.lua b/bushes/init.lua index f7dce5a..a338012 100644 --- a/bushes/init.lua +++ b/bushes/init.lua @@ -7,67 +7,83 @@ abstract_bushes = {} - minetest.register_node("bushes:bushbranches1", { - description = "bushbranches1", - drawtype = "nodebox", - tiles = { - "blank.png", - "BushBranchesCenter.png", - "BushBranchesCenter.png", - "BushBranchesCenter.png", - "BushBranchesCenter.png", - "BushBranchesCenter.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 = "BushBranchesCenter.png", - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - groups = {tree=1, snappy=3, flammable=2, leaves=1}, - sounds = default.node_sound_leaves_defaults(), -}) - -local BushBranchNode = { {2}, {3}} -for i in pairs(BushBranchNode) do - local Num = BushBranchNode[i][1] + 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 = "bushbranches"..Num, + description = "Bush Branches "..Num, drawtype = "nodebox", tiles = { - "blank.png", - "BushBranchesSide1.png", - "BushBranchesSide1.png", - "BushBranchesSide2.png", - "BushBranchesSide2.png", - "BushBranchesCenter.png" + "bush_leaves"..TexNum..".png", + "BushBranchesCenterLeaves"..TexNum..".png"--[[, + "BushBranchesCenter.png", + "BushBranchesCenter.png", + "BushBranchesCenter.png", + "BushBranchesCenter.png"]] }, node_box = { type = "fixed", fixed = { - {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.500000,-0.500000,0.500000,-0.500000}, --NodeBox 3 + {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 = "BushBranchesCenter.png", + inventory_image = "BushBranchesCenterLeaves"..TexNum..".png", paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, - groups = {tree=1, snappy=3, flammable=2, leaves=1}, + 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 = { + "bush_leaves"..TexNum..".png", + "BushBranchesCenterLeaves"..TexNum..".png", + "BushBranchesSide1Leaves"..TexNum..".png", + "BushBranchesSide1Leaves"..TexNum..".png", + "BushBranchesSide2Leaves"..TexNum..".png", -- MM: We could also mirror the previous here, + "BushBranchesSide2Leaves"..TexNum..".png" -- unless U really want 'em 2 B different + }, + node_box = { + type = "fixed", + fixed = { + {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.500000,-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 = "BushBranchesSide2Leaves"..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 @@ -81,7 +97,7 @@ for i in pairs(BushLeafNode) do tiles = {"bush_leaves"..Num..".png"}, inventory_image = "bush_leaves"..Num..".png", paramtype = "light", - groups = { + groups = { -- MM: Should we add leafdecay? snappy=3, flammable=2, attached_node=1 @@ -127,11 +143,25 @@ abstract_bushes.grow_bush_node = function(pos,dir, leaf_type) 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 + --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 + dir = 1 + end + if dir ~= 5 and leaf_type == 2 then + bush_branch_type = 4 + dir = 1 + 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 diff --git a/bushes/textures/BushBranchesCenterLeaves2.png b/bushes/textures/BushBranchesCenterLeaves2.png new file mode 100644 index 0000000..2009b50 Binary files /dev/null and b/bushes/textures/BushBranchesCenterLeaves2.png differ diff --git a/bushes/textures/BushBranchesSide1Leaves2.png b/bushes/textures/BushBranchesSide1Leaves2.png new file mode 100644 index 0000000..cb3e237 Binary files /dev/null and b/bushes/textures/BushBranchesSide1Leaves2.png differ diff --git a/bushes/textures/BushBranchesSide2Leaves2.png b/bushes/textures/BushBranchesSide2Leaves2.png new file mode 100644 index 0000000..55184a4 Binary files /dev/null and b/bushes/textures/BushBranchesSide2Leaves2.png differ diff --git a/bushes/textures/BlockBranch1.png b/bushes/textures/old & unused/BlockBranch1.png similarity index 100% rename from bushes/textures/BlockBranch1.png rename to bushes/textures/old & unused/BlockBranch1.png diff --git a/bushes/textures/BlockBranch1L.png b/bushes/textures/old & unused/BlockBranch1L.png similarity index 100% rename from bushes/textures/BlockBranch1L.png rename to bushes/textures/old & unused/BlockBranch1L.png diff --git a/bushes/textures/BlockBranch1R.png b/bushes/textures/old & unused/BlockBranch1R.png similarity index 100% rename from bushes/textures/BlockBranch1R.png rename to bushes/textures/old & unused/BlockBranch1R.png diff --git a/bushes/textures/BushBranches1.png b/bushes/textures/old & unused/BushBranches1.png similarity index 100% rename from bushes/textures/BushBranches1.png rename to bushes/textures/old & unused/BushBranches1.png diff --git a/bushes/textures/BushBranches1sm.png b/bushes/textures/old & unused/BushBranches1sm.png similarity index 100% rename from bushes/textures/BushBranches1sm.png rename to bushes/textures/old & unused/BushBranches1sm.png diff --git a/bushes/textures/BushBranches1sm2.png b/bushes/textures/old & unused/BushBranches1sm2.png similarity index 100% rename from bushes/textures/BushBranches1sm2.png rename to bushes/textures/old & unused/BushBranches1sm2.png diff --git a/bushes/textures/BushBranches1sm3.png b/bushes/textures/old & unused/BushBranches1sm3.png similarity index 100% rename from bushes/textures/BushBranches1sm3.png rename to bushes/textures/old & unused/BushBranches1sm3.png diff --git a/bushes/textures/BushBranches1sm4.png b/bushes/textures/old & unused/BushBranches1sm4.png similarity index 100% rename from bushes/textures/BushBranches1sm4.png rename to bushes/textures/old & unused/BushBranches1sm4.png diff --git a/bushes/textures/BushBranchesCenter.png b/bushes/textures/old & unused/BushBranchesCenter.png similarity index 100% rename from bushes/textures/BushBranchesCenter.png rename to bushes/textures/old & unused/BushBranchesCenter.png diff --git a/bushes/textures/BushBranchesSide1.png b/bushes/textures/old & unused/BushBranchesSide1.png similarity index 100% rename from bushes/textures/BushBranchesSide1.png rename to bushes/textures/old & unused/BushBranchesSide1.png diff --git a/bushes/textures/BushBranchesSide2.png b/bushes/textures/old & unused/BushBranchesSide2.png similarity index 100% rename from bushes/textures/BushBranchesSide2.png rename to bushes/textures/old & unused/BushBranchesSide2.png diff --git a/bushes/textures/moretrees_pine_leaves3.png b/bushes/textures/old & unused/moretrees_pine_leaves3.png similarity index 100% rename from bushes/textures/moretrees_pine_leaves3.png rename to bushes/textures/old & unused/moretrees_pine_leaves3.png