mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-29 12:10:37 +01:00
Make use of minetest.load_area
This commit is contained in:
parent
e6fac23c53
commit
602f175cc0
@ -47,10 +47,15 @@ end
|
|||||||
|
|
||||||
function worldedit.keep_loaded(pos1, pos2)
|
function worldedit.keep_loaded(pos1, pos2)
|
||||||
-- Create a vmanip and read the area from map, this
|
-- Create a vmanip and read the area from map, this
|
||||||
-- causes all MapBlocks to be loaded into memory.
|
-- causes all MapBlocks to be loaded into memory synchronously.
|
||||||
-- This doesn't actually *keep* them loaded, unlike the name implies.
|
-- This doesn't actually *keep* them loaded, unlike the name implies.
|
||||||
local manip = minetest.get_voxel_manip()
|
if minetest.load_area then
|
||||||
manip:read_from_map(pos1, pos2)
|
-- same effect but without unnecessary data copying
|
||||||
|
minetest.load_area(pos1, pos2)
|
||||||
|
else
|
||||||
|
local manip = minetest.get_voxel_manip()
|
||||||
|
manip:read_from_map(pos1, pos2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user