Allow loading newer (versioned) WorldEdit schematics

This commit is contained in:
sfan5 2016-10-28 23:19:14 +02:00
parent 09a4382429
commit 8da8ad5495

3
we.lua
View File

@ -14,6 +14,9 @@ function import_scm(scm)
end
local value = f:read("*a")
f:close()
if value:sub(1, 2) == "5:" then
value = value:sub(3)
end
value = value:gsub("return%s*{", "", 1):gsub("}%s*$", "", 1)
local escaped = value:gsub("\\\\", "@@"):gsub("\\\"", "@@"):gsub("(\"[^\"]*\")", function(s) return string.rep("@", #s) end)
local startpos, startpos1, endpos = 1, 1