mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 15:33:00 +00:00
removed tests
This commit is contained in:
parent
f6ed5241b4
commit
6e3b9d99e9
2 changed files with 5 additions and 7 deletions
|
@ -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`.
|
The above functions just like `//replace` - nothing special going on here. It replaces all `dirt` nodes with `stone`.
|
||||||
|
|
||||||
|
|
||||||
Let's make it more interesting:
|
Let's make it more interesting:
|
||||||
|
|
||||||
```weacmd
|
```weacmd
|
||||||
|
@ -722,7 +723,7 @@ Short for _select relative_. Sets the pos2 at set distances along 3 axes relativ
|
||||||
//srel front 5
|
//srel front 5
|
||||||
//srel y 12 right -2
|
//srel y 12 right -2
|
||||||
//srel left 3 up 5 -front 7
|
//srel left 3 up 5 -front 7
|
||||||
//scube -z 12 -y -2 x -2
|
//srel -z 12 -y -2 x -2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,27 +9,24 @@
|
||||||
-- @param {string} node1 Name of the node to place
|
-- @param {string} node1 Name of the node to place
|
||||||
-- @param {string} node2 Name of the node of the bead
|
-- @param {string} node2 Name of the node of the bead
|
||||||
function worldeditadditions.make_compass(pos1,node1,node2)
|
function worldeditadditions.make_compass(pos1,node1,node2)
|
||||||
local debug, ret = "", {}
|
|
||||||
minetest.set_node(vector.add(pos1,vector.new(0,1,3)), {name=node2})
|
minetest.set_node(vector.add(pos1,vector.new(0,1,3)), {name=node2})
|
||||||
local counts = { replaced = 1 }
|
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)
|
-- 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
|
for z = -3,3 do
|
||||||
if z ~= 0 then
|
if z ~= 0 then
|
||||||
for k,x in pairs({math.floor(-3/math.abs(z)),0,math.ceil(3/math.abs(z))}) do
|
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})
|
minetest.set_node(vector.new(pos1.x+x,pos1.y,pos1.z+z), {name=node1})
|
||||||
counts.replaced = counts.replaced + 1
|
counts.replaced = counts.replaced + 1
|
||||||
table.insert(ret,x)
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
for x = -3,3 do
|
for x = -3,3 do
|
||||||
minetest.set_node(vector.new(pos1.x+x,pos1.y,pos1.z), {name=node1})
|
minetest.set_node(vector.new(pos1.x+x,pos1.y,pos1.z), {name=node1})
|
||||||
counts.replaced = counts.replaced + 1
|
counts.replaced = counts.replaced + 1
|
||||||
table.insert(ret,pos1.x+x)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
debug = debug..z.." -- "..table.concat(ret,", ").."\n"
|
|
||||||
ret={}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return true, debug..counts.replaced
|
return true, counts.replaced
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue