mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 00:53:00 +00:00
corner set working
This commit is contained in:
parent
1a78e61c31
commit
0c9987c745
1 changed files with 1 additions and 2 deletions
|
@ -9,14 +9,13 @@
|
|||
-- @param {Position} pos2 The 2nd positioon defining the WorldEdit selection
|
||||
-- @param {string} node Name of the node to place
|
||||
function worldeditadditions.corner_set(pos1,pos2,node)
|
||||
local node_id_replace = minetest.get_content_id(node)
|
||||
|
||||
-- z y x is the preferred loop order (because CPU cache I'd guess, since then we're iterating linearly through the data array)
|
||||
local counts = { replaced = 0 }
|
||||
for k,z in pairs({pos1.z,pos2.z}) do
|
||||
for k,y in pairs({pos1.y,pos2.y}) do
|
||||
for k,x in pairs({pos1.x,pos2.x}) do
|
||||
minetest.set_node(vector.new(x,y,z), node_id_replace)
|
||||
minetest.set_node(vector.new(x,y,z), {name=node})
|
||||
counts.replaced = counts.replaced + 1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue