Continuation Passing Style lets me use minetest.after, so the server
gets a chance to not hang in between every stack iteration. Could even
set minetest.after(1000,nextone) if you want to see it extend once every
second.
if count < 0 then\r
count = -count\r
length = -length\r
- end\r
- local amount = 0\r
- local copy = worldedit.copy\r
- for i = 1, count do\r
- amount = amount + length\r
- copy(pos1, pos2, axis, amount)\r
- end\r
+ end\r
+ local amount = 0\r
+ local copy = worldedit.copy\r
+ local i = 1\r
+ function nextone() \r
+ if i <= count then\r
+ i = i + 1\r
+ amount = amount + length\r
+ copy(pos1, pos2, axis, amount)\r
+ minetest.after(0,nextone)\r
+ end\r
+ end\r
+ nextone()\r
return worldedit.volume(pos1, pos2) * count\r
end\r
\r