63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
offsets = ofs;
purge_container = function(...) return purge_container(nil, ...) end;
purge_only = function(lst)
return function(...)
return purge_container(lst, ...)
end
end;
amass = function(startpoint,names,directions)
if not directions then directions = ofs.neighbors end
local nodes, positions, checked = {},{},{}
local checkedp = function(pos)
for _,v in pairs(checked) do
if vector.equals(pos,v) then return true end
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
offsets = ofs;
purge_container = function(...) return purge_container(nil, ...) end;
purge_only = function(lst)
return function(...)
return purge_container(lst, ...)
end
end;
is_air = function(pos)
local n = sorcery.lib.node.force(pos)
if n.name == 'air' then return true end
local d = minetest.registered_nodes[n.name]
if not d then return false end
return not d.walkable
end;
get_arrival_point = function(pos)
local air = sorcery.lib.node.is_air
if air(pos) then
local n = {x=0,y=1,z=0}
if air(vector.add(pos,n)) then return pos end
local down = vector.subtract(pos,n)
if air(down) then return down end
else return nil end
end;
amass = function(startpoint,names,directions)
if not directions then directions = ofs.neighbors end
local nodes, positions, checked = {},{},{}
local checkedp = function(pos)
for _,v in pairs(checked) do
if vector.equals(pos,v) then return true end
|