1 local wall_pos1
={x
=-1254,y
=-4,z
=791} --not the exact ones rn
2 local wall_pos2
={x
=-1454,y
=80,z
=983}
3 local iwall_pos1
={x
=-1264,y
=-4,z
=801}
4 local iwall_pos2
={x
=-1444,y
=80,z
=973}
8 local function between(x
, y
, z
) -- x is between y and z (inclusive)
9 return y
<= x
and x
<= z
13 local function in_cube(tpos
,wpos1
,wpos2
)
22 if wpos1
.x
> wpos2
.x
then
26 if wpos1
.y
> wpos2
.y
then
30 if wpos1
.z
> wpos2
.z
then
34 if between(tpos
.x
,xmin
,xmax
) and between(tpos
.y
,ymin
,ymax
) and between(tpos
.z
,zmin
,zmax
) then
40 local function in_wall(pos
)
41 if in_cube(pos
,wall_pos1
,wall_pos2
) and not in_cube(pos
,iwall_pos1
,iwall_pos2
) then
46 scaffold
.register_template_scaffold("WallTool", "scaffold_walltool", function(pos
)
47 local lp
=minetest
.localplayer
:get_pos()
48 local p1
=vector
.add(lp
,{x
=5,y
=5,z
=5})
49 local p2
=vector
.add(lp
,{x
=-5,y
=-5,z
=-5})
50 local nn
=nlist
.get_mclnodes()
51 table.insert(nn
,'air')
52 local nds
,cnt
=minetest
.find_nodes_in_area(p1
,p2
,nn
,true)
53 for k
,v
in pairs(nds
) do for kk
,vv
in pairs(v
) do
54 if vv
and in_wall(vv
) then
55 scaffold
.place_if_needed({'mcl_core:cobble'},vv
)
56 local nd
=minetest
.get_node_or_nil(vv
)
57 if nd
and nd
.name
~= 'mcl_core:cobble' then