You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: worldedit/manipulations.lua
+76-16Lines changed: 76 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
1
worldedit=worldeditor {}
2
2
localminetest=minetest--local copy of global
3
3
4
-
--wip: remove env parameter where no longer needed in chat commands module
5
4
--wip: fix the queue
6
5
7
6
--modifies positions `pos1` and `pos2` so that each component of `pos1` is less than or equal to its corresponding conent of `pos2`, returning two new positions
--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
116
169
worldedit.copy=function(pos1, pos2, axis, amount)
117
170
localpos1, pos2=worldedit.sort_pos(pos1, pos2)
118
171
119
-
--wip: copy slice by slice using schematic method in the copy axis and transfer metadata in separate loop (and if the amount is greater than the length in the axis, copy whole thing at a time), use voxelmanip to keep area loaded
--wip: move slice by slice using schematic method in the move axis and transfer metadata in separate loop (and if the amount is greater than the length in the axis, copy whole thing at a time and erase original after, using schematic method), use voxelmanip to keep area loaded
225
+
--make area stay loaded
226
+
localmanip=minetest.get_voxel_manip()
227
+
manip:read_from_map(pos1, pos2)
228
+
229
+
--wip: move slice by slice using schematic method in the move axis and transfer metadata in separate loop (and if the amount is greater than the length in the axis, copy whole thing at a time and erase original after, using schematic method)
--duplicates the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") `count` times, returning the number of nodes stacked
--transposes a region defined by the positions `pos1` and `pos2` between the `axis1` and `axis2` axes, returning the number of nodes transposed, the new transposed position 1, and the new transposed position 2
--rotates a region defined by the positions `pos1` and `pos2` by `angle` degrees clockwise around axis `axis` (90 degree increment), returning the number of nodes rotated
--rotates all oriented nodes in a region defined by the positions `pos1` and `pos2` by `angle` degrees clockwise (90 degree increment) around the Y axis, returning the number of nodes oriented
419
-
worldedit.orient=function(pos1, pos2, angle, env) --wip: support 6D facedir rotation along arbitrary axis
479
+
worldedit.orient=function(pos1, pos2, angle) --wip: support 6D facedir rotation along arbitrary axis
--adds a spiral centered at `pos` with width `width`, height `height`, space between walls `spacer`, composed of `nodename`, returning the number of nodes added
414
-
worldedit.spiral=function(pos, width, height, spacer, nodename, env) --wip: rewrite this whole thing, nobody can understand it anyways
localfunctionsindex(z, x) -- returns the value at (x, z) in a spiral that starts at 1 and goes outwards
419
-
ifz==-xandz>=xthenreturn (2*z+1)^2end
420
-
locallongest=math.max(abs(z), abs(x))
421
-
return (2*longest-1)^2+4*longest+2*longest*sign(x+z) +sign(z^2-x^2)*(longest-(abs(z)==longestandsign(z)*xorsign(x)*z)) -- OH GOD WHAT
410
+
--adds a spiral centered at `pos` with side length `length`, height `height`, space between walls `spacer`, composed of `nodename`, returning the number of nodes added
0 commit comments