-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbreaking.lua
More file actions
45 lines (45 loc) · 1.46 KB
/
Copy pathbreaking.lua
File metadata and controls
45 lines (45 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function break_childs(pos, oldnode, is_root)
local param2 = oldnode.param2
if param2 ~= 3 or is_root then
local curpos = vector.add(pos, {x = -1, y = 0, z = 0})
local node = minetest.get_node(curpos)
if node.name:sub(0, 19) == "living_trees:branch" and node.param2 == 2 then
minetest.dig_node(curpos)
end
end
if param2 ~= 2 or is_root then
curpos = vector.add(pos, {x = 1, y = 0, z = 0})
node = minetest.get_node(curpos)
if node.name:sub(0, 19) == "living_trees:branch" and node.param2 == 3 then
minetest.dig_node(curpos)
end
end
if param2 ~= 1 or is_root then
curpos = vector.add(pos, {x = 0, y = -1, z = 0})
node = minetest.get_node(curpos)
if node.name:sub(0, 19) == "living_trees:branch" and node.param2 == 0 then
minetest.dig_node(curpos)
end
end
if param2 ~= 0 or is_root then
curpos = vector.add(pos, {x = 0, y = 1, z = 0})
node = minetest.get_node(curpos)
if node.name:sub(0, 19) == "living_trees:branch" and node.param2 == 1 then
minetest.dig_node(curpos)
end
end
if param2 ~= 5 or is_root then
curpos = vector.add(pos, {x = 0, y = 0, z = -1})
node = minetest.get_node(curpos)
if node.name:sub(0, 19) == "living_trees:branch" and node.param2 == 4 then
minetest.dig_node(curpos)
end
end
if param2 ~= 4 or is_root then
curpos = vector.add(pos, {x = 0, y = 0, z = 1})
node = minetest.get_node(curpos)
if node.name:sub(0, 19) == "living_trees:branch" and node.param2 == 5 then
minetest.dig_node(curpos)
end
end
end