added easier strut_line_dir functions
This commit is contained in:
parent
6da257982f
commit
841dde100b
@ -69,6 +69,38 @@ local function clear_area(pos, pos2)
|
||||
end
|
||||
end
|
||||
|
||||
local function place_strut(x, y, z)
|
||||
local position = { x=x3, y=y, z=z }
|
||||
if minetest.get_node(position) == "air" then
|
||||
minetest.set_node(position, { name = NAME .. "static_strut"})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function strut_line_x(x, y, z, x2)
|
||||
local minx = min(x, x2)
|
||||
local maxx = max(x, x2)
|
||||
for x3=xmin, xmax do
|
||||
place_strut(x3, y, z)
|
||||
end
|
||||
end
|
||||
|
||||
local function strut_line_y(x, y, z, y2)
|
||||
local miny = min(y, y2)
|
||||
local maxy = max(y, y2)
|
||||
for y3=ymin, ymax do
|
||||
place_strut(x, y3, z)
|
||||
end
|
||||
end
|
||||
|
||||
local function strut_line_z(x, y, z, z2)
|
||||
local minz = min(z, z2)
|
||||
local maxz = max(z, z2)
|
||||
for z3=zmin, zmax do
|
||||
place_strut(x, y, z3)
|
||||
end
|
||||
end
|
||||
|
||||
local function struct_line(pos, pos2)
|
||||
local minx = pos.x
|
||||
local maxx = pos2.x
|
||||
|
Loading…
x
Reference in New Issue
Block a user