Skip to content

Commit

Permalink
Update stack2 API documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Uberi committed Jul 6, 2014
1 parent 175ac21 commit 9616c7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions WorldEdit API.md
Expand Up @@ -57,6 +57,12 @@ Duplicates the region defined by positions `pos1` and `pos2` along the `axis` ax

Returns the number of nodes stacked.

### count = worldedit.stack2(pos1, pos2, direction, amount)

Duplicates the region defined by positions `pos1` and `pos2` `amount` times with offset vector `direction`.

Returns the number of nodes stacked.

### count, newpos1, newpos2 = worldedit.stretch(pos1, pos2, stretchx, stretchy, stretchz)

Stretches the region defined by positions `pos1` and `pos2` by an factor of positive integers `stretchx`, `stretchy`. and `stretchz` along the X, Y, and Z axes, respectively, with `pos1` as the origin.
Expand Down
4 changes: 3 additions & 1 deletion worldedit/manipulations.lua
Expand Up @@ -124,6 +124,7 @@ worldedit.replaceinverse = function(pos1, pos2, searchnode, replacenode)
return count
end

--copies the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes, returning the number of nodes copied
worldedit.copy = function(pos1, pos2, axis, amount) --wip: replace the old version below
local pos1, pos2 = worldedit.sort_pos(pos1, pos2)

Expand Down Expand Up @@ -282,6 +283,7 @@ worldedit.copy2 = function(pos1, pos2, direction, volume)
end
end

--duplicates the region defined by positions `pos1` and `pos2` `amount` times with offset vector `direction`, returning the number of nodes stacked
worldedit.stack2 = function(pos1, pos2, direction, amount, finished)
local i = 0
local translated = {x=0,y=0,z=0}
Expand All @@ -300,7 +302,7 @@ worldedit.stack2 = function(pos1, pos2, direction, amount, finished)
end
end
nextone()
return nil
return worldedit.volume(pos1, pos2) * amount
end

--copies the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes, returning the number of nodes copied
Expand Down

0 comments on commit 9616c7d

Please sign in to comment.