summaryrefslogtreecommitdiff
path: root/worldedit/queue.lua
diff options
context:
space:
mode:
authorAnthony Zhang <azhang9@gmail.com>2013-07-21 16:54:25 -0400
committerAnthony Zhang <azhang9@gmail.com>2013-07-21 16:54:25 -0400
commit8ebf9d3c2ae63374c5501be0660b0d57204bd335 (patch)
tree6c943fc82110d45a9e330f8e7f6a0a5452e8110c /worldedit/queue.lua
parentac5e801834245bcf93f720d290a36b09a2527576 (diff)
Super duper VoxelManipulator speedups to nearly every API function, and plus support for unloaded areas. Still in progress. Also, fix //allocate for very large schematics.
Diffstat (limited to 'worldedit/queue.lua')
-rw-r--r--worldedit/queue.lua27
1 files changed, 12 insertions, 15 deletions
diff --git a/worldedit/queue.lua b/worldedit/queue.lua
index 9246b9d..e9f3ac3 100644
--- a/worldedit/queue.lua
+++ b/worldedit/queue.lua
@@ -12,41 +12,39 @@ minetest.register_globalstep(function(dtime)
local elapsed = 0
local env = minetest.env
while worldedit.lower <= worldedit.higher and elapsed <= worldedit.MAXIMUM_TIME do
- local entry = worldedit.queue[worldedit.lower]
+ local entry = worldedit.queue[worldedit.lower]
if entry.t == "set_node" then
env:set_node(entry.pos, entry.node)
- elapsed = elapsed + 0.0002
+ elapsed = elapsed + 0.0002
elseif entry.t == "remove_node" then
env:remove_node(entry.pos)
- elapsed = elapsed + 0.0002
+ elapsed = elapsed + 0.0002
elseif entry.t == "place_node" then
env:place_node(entry.pos, entry.node)
- elapsed = elapsed + 0.001
+ elapsed = elapsed + 0.001
elseif entry.t == "dig_node" then
env:dig_node(entry.pos)
- elapsed = elapsed + 0.001
+ elapsed = elapsed + 0.001
elseif entry.t == "add_entity" then
env:add_entity(entry.pos, entry.name)
- elapsed = elapsed + 0.005
+ elapsed = elapsed + 0.005
elseif entry.t == "add_item" then
env:add_item(entry.pos, entry.item)
- elapsed = elapsed + 0.005
+ elapsed = elapsed + 0.005
elseif entry.t == "meta_from_table" then
env:get_meta(entry.pos):from_table(entry.table)
- elapsed = elapsed + 0.0002
+ elapsed = elapsed + 0.0002
else
print("Unknown queue event type: " .. entry.t)
end
worldedit.queue[worldedit.lower] = nil
- worldedit.lower = worldedit.lower + 1
+ worldedit.lower = worldedit.lower + 1
end
end)
-do
- worldedit.enqueue = function(value)
- worldedit.higher = worldedit.higher + 1
- worldedit.queue[worldedit.higher] = value
- end
+worldedit.enqueue = function(value)
+ worldedit.higher = worldedit.higher + 1
+ worldedit.queue[worldedit.higher] = value
end
function table.copy(t, seen)
@@ -123,4 +121,3 @@ worldedit.queue_aliasenv = {
add_entity = queue_addentity,
add_item = queue_additem,
}
-