forked from mtcontrib/Minetest-WorldEdit
Replace more deprecated functions
This commit is contained in:
@ -93,14 +93,6 @@ function worldedit.player_axis(name)
|
||||
return "z", dir.z > 0 and 1 or -1
|
||||
end
|
||||
|
||||
local function mkdir(path)
|
||||
if minetest.mkdir then
|
||||
minetest.mkdir(path)
|
||||
else
|
||||
os.execute('mkdir "' .. path .. '"')
|
||||
end
|
||||
end
|
||||
|
||||
local function check_filename(name)
|
||||
return name:find("^[%w%s%^&'@{}%[%],%$=!%-#%(%)%%%.%+~_]+$") ~= nil
|
||||
end
|
||||
@ -1115,7 +1107,7 @@ minetest.register_chatcommand("/save", {
|
||||
|
||||
local path = minetest.get_worldpath() .. "/schems"
|
||||
-- Create directory if it does not already exist
|
||||
mkdir(path)
|
||||
minetest.mkdir(path)
|
||||
|
||||
local filename = path .. "/" .. param .. ".we"
|
||||
local file, err = io.open(filename, "wb")
|
||||
@ -1282,7 +1274,7 @@ minetest.register_chatcommand("/mtschemcreate", {
|
||||
|
||||
local path = minetest.get_worldpath() .. "/schems"
|
||||
-- Create directory if it does not already exist
|
||||
mkdir(path)
|
||||
minetest.mkdir(path)
|
||||
|
||||
local filename = path .. "/" .. param .. ".mts"
|
||||
local ret = minetest.create_schematic(worldedit.pos1[name],
|
||||
|
@ -64,7 +64,7 @@ worldedit.mark_region = function(name)
|
||||
|
||||
local vec = vector.subtract(pos2, pos1)
|
||||
local maxside = math.max(vec.x, math.max(vec.y, vec.z))
|
||||
local limit = tonumber(minetest.setting_get("active_object_send_range_blocks")) * 16
|
||||
local limit = tonumber(minetest.settings:get("active_object_send_range_blocks")) * 16
|
||||
if maxside > limit * 1.5 then
|
||||
-- The client likely won't be able to see the plane markers as intended anyway,
|
||||
-- thus don't place them and also don't load the area into memory
|
||||
@ -101,7 +101,7 @@ worldedit.mark_region = function(name)
|
||||
visual_size={x=sizez * 2, y=sizey * 2},
|
||||
collisionbox = {-thickness, -sizey, -sizez, thickness, sizey, sizez},
|
||||
})
|
||||
marker:setyaw(math.pi / 2)
|
||||
marker:set_yaw(math.pi / 2)
|
||||
marker:get_luaentity().player_name = name
|
||||
table.insert(markers, marker)
|
||||
end
|
||||
|
Reference in New Issue
Block a user