summaryrefslogtreecommitdiff
path: root/worldedit/compatibility.lua
diff options
context:
space:
mode:
Diffstat (limited to 'worldedit/compatibility.lua')
-rw-r--r--worldedit/compatibility.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/worldedit/compatibility.lua b/worldedit/compatibility.lua
index ff3447f..e44e43b 100644
--- a/worldedit/compatibility.lua
+++ b/worldedit/compatibility.lua
@@ -2,7 +2,9 @@ worldedit = worldedit or {}
local minetest = minetest --local copy of global
worldedit.allocate_old = worldedit.allocate
+
worldedit.deserialize_old = worldedit.deserialize
+
worldedit.metasave = function(pos1, pos2, filename)
local file, err = io.open(filename, "wb")
if err then return 0 end
@@ -11,6 +13,7 @@ worldedit.metasave = function(pos1, pos2, filename)
file:close()
return count
end
+
worldedit.metaload = function(originpos, filename)
filename = minetest.get_worldpath() .. "/schems/" .. file .. ".wem"
local file, err = io.open(filename, "wb")
@@ -18,6 +21,16 @@ worldedit.metaload = function(originpos, filename)
local data = file:read("*a")
return worldedit.deserialize(originpos, data)
end
+
worldedit.scale = function(pos1, pos2, factor)
return worldedit.stretch(pos1, pos2, factor, factor, factor)
-end \ No newline at end of file
+end
+
+worldedit.valueversion = function(value)
+ local version = worldedit.read_header(value)
+ if not version or version > worldedit.LATEST_SERIALIZATION_VERSION then
+ return 0
+ end
+ return version
+end
+