Bush branches with leaves 2, code for spawning
@ -7,16 +7,20 @@
|
|||||||
|
|
||||||
abstract_bushes = {}
|
abstract_bushes = {}
|
||||||
|
|
||||||
minetest.register_node("bushes:bushbranches1", {
|
local BushBranchCenter = { {1,1}, {3,2} }
|
||||||
description = "bushbranches1",
|
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",
|
drawtype = "nodebox",
|
||||||
tiles = {
|
tiles = {
|
||||||
"blank.png",
|
"bush_leaves"..TexNum..".png",
|
||||||
|
"BushBranchesCenterLeaves"..TexNum..".png"--[[,
|
||||||
"BushBranchesCenter.png",
|
"BushBranchesCenter.png",
|
||||||
"BushBranchesCenter.png",
|
"BushBranchesCenter.png",
|
||||||
"BushBranchesCenter.png",
|
"BushBranchesCenter.png",
|
||||||
"BushBranchesCenter.png",
|
"BushBranchesCenter.png"]]
|
||||||
"BushBranchesCenter.png"
|
|
||||||
},
|
},
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -29,27 +33,34 @@
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2},
|
fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2},
|
||||||
},
|
},
|
||||||
inventory_image = "BushBranchesCenter.png",
|
inventory_image = "BushBranchesCenterLeaves"..TexNum..".png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
sunlight_propagates = true,
|
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(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
local BushBranchNode = { {2}, {3}}
|
local BushBranchSide = { {2,1}, {4,2} }
|
||||||
for i in pairs(BushBranchNode) do
|
for i in pairs(BushBranchSide) do
|
||||||
local Num = BushBranchNode[i][1]
|
local Num = BushBranchSide[i][1]
|
||||||
|
local TexNum = BushBranchSide[i][2]
|
||||||
minetest.register_node("bushes:bushbranches"..Num, {
|
minetest.register_node("bushes:bushbranches"..Num, {
|
||||||
description = "bushbranches"..Num,
|
description = "Bush Branches "..Num,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {
|
tiles = {
|
||||||
"blank.png",
|
"bush_leaves"..TexNum..".png",
|
||||||
"BushBranchesSide1.png",
|
"BushBranchesCenterLeaves"..TexNum..".png",
|
||||||
"BushBranchesSide1.png",
|
"BushBranchesSide1Leaves"..TexNum..".png",
|
||||||
"BushBranchesSide2.png",
|
"BushBranchesSide1Leaves"..TexNum..".png",
|
||||||
"BushBranchesSide2.png",
|
"BushBranchesSide2Leaves"..TexNum..".png", -- MM: We could also mirror the previous here,
|
||||||
"BushBranchesCenter.png"
|
"BushBranchesSide2Leaves"..TexNum..".png" -- unless U really want 'em 2 B different
|
||||||
},
|
},
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -63,11 +74,16 @@ for i in pairs(BushBranchNode) do
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2},
|
fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2},
|
||||||
},
|
},
|
||||||
inventory_image = "BushBranchesCenter.png",
|
inventory_image = "BushBranchesSide2Leaves"..TexNum..".png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
sunlight_propagates = true,
|
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(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@ -81,7 +97,7 @@ for i in pairs(BushLeafNode) do
|
|||||||
tiles = {"bush_leaves"..Num..".png"},
|
tiles = {"bush_leaves"..Num..".png"},
|
||||||
inventory_image = "bush_leaves"..Num..".png",
|
inventory_image = "bush_leaves"..Num..".png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
groups = {
|
groups = { -- MM: Should we add leafdecay?
|
||||||
snappy=3,
|
snappy=3,
|
||||||
flammable=2,
|
flammable=2,
|
||||||
attached_node=1
|
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 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 = math.random(1,3)
|
||||||
local bush_branch_type = 2
|
--local bush_branch_type = 2
|
||||||
if dir == 5 then
|
|
||||||
|
-- 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
|
bush_branch_type = 1
|
||||||
dir = 1
|
dir = 1
|
||||||
end
|
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,
|
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
or minetest.get_node(right_here).name == "default:junglegrass" then
|
||||||
|
BIN
bushes/textures/BushBranchesCenterLeaves2.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
bushes/textures/BushBranchesSide1Leaves2.png
Normal file
After Width: | Height: | Size: 689 B |
BIN
bushes/textures/BushBranchesSide2Leaves2.png
Normal file
After Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 702 B After Width: | Height: | Size: 702 B |
Before Width: | Height: | Size: 714 B After Width: | Height: | Size: 714 B |
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 649 B After Width: | Height: | Size: 649 B |
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
Before Width: | Height: | Size: 770 B After Width: | Height: | Size: 770 B |
Before Width: | Height: | Size: 801 B After Width: | Height: | Size: 801 B |
Before Width: | Height: | Size: 647 B After Width: | Height: | Size: 647 B |