removed tests

This commit is contained in:
VorTechnix 2021-07-23 16:21:58 -07:00
parent f6ed5241b4
commit 6e3b9d99e9
2 changed files with 5 additions and 7 deletions

View File

@ -371,6 +371,7 @@ This command is best explained with examples:
The above functions just like `//replace` - nothing special going on here. It replaces all `dirt` nodes with `stone`.
Let's make it more interesting:
```weacmd
@ -722,7 +723,7 @@ Short for _select relative_. Sets the pos2 at set distances along 3 axes relativ
//srel front 5
//srel y 12 right -2
//srel left 3 up 5 -front 7
//scube -z 12 -y -2 x -2
//srel -z 12 -y -2 x -2
```

View File

@ -9,27 +9,24 @@
-- @param {string} node1 Name of the node to place
-- @param {string} node2 Name of the node of the bead
function worldeditadditions.make_compass(pos1,node1,node2)
local debug, ret = "", {}
minetest.set_node(vector.add(pos1,vector.new(0,1,3)), {name=node2})
local counts = { replaced = 1 }
-- z y x is the preferred loop order (because CPU cache I'd guess, since then we're iterating linearly through the data array)
for z = -3,3 do
if z ~= 0 then
for k,x in pairs({math.floor(-3/math.abs(z)),0,math.ceil(3/math.abs(z))}) do
minetest.set_node(vector.new(pos1.x+x,pos1.y,pos1.z+z), {name=node1})
counts.replaced = counts.replaced + 1
table.insert(ret,x)
end
else
for x = -3,3 do
minetest.set_node(vector.new(pos1.x+x,pos1.y,pos1.z), {name=node1})
counts.replaced = counts.replaced + 1
table.insert(ret,pos1.x+x)
end
end
debug = debug..z.." -- "..table.concat(ret,", ").."\n"
ret={}
end
return true, debug..counts.replaced
return true, counts.replaced
end