mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-12-14 14:28:29 +01:00
initial commit
subgame + mods
This commit is contained in:
23
mods/WorldEdit/worldedit/compatibility.lua
Executable file
23
mods/WorldEdit/worldedit/compatibility.lua
Executable file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
local data, count = worldedit.serialize(pos1, pos2)
|
||||
file:write(data)
|
||||
file:close()
|
||||
return count
|
||||
end
|
||||
worldedit.metaload = function(originpos, filename)
|
||||
filename = minetest.get_worldpath() .. "/schems/" .. file .. ".wem"
|
||||
local file, err = io.open(filename, "wb")
|
||||
if err then return 0 end
|
||||
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
|
||||
Reference in New Issue
Block a user