mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-09-27 15:10:17 +02:00
parent
8a1d788823
commit
f8d62c9464
|
@ -160,7 +160,7 @@ end
|
||||||
--- Loads the schematic in `value` into a node list in the latest format.
|
--- Loads the schematic in `value` into a node list in the latest format.
|
||||||
-- @return A node list in the latest format, or nil on failure.
|
-- @return A node list in the latest format, or nil on failure.
|
||||||
local function load_schematic(value)
|
local function load_schematic(value)
|
||||||
local version, header, content = worldedit.read_header(value)
|
local version, _, content = worldedit.read_header(value)
|
||||||
local nodes = {}
|
local nodes = {}
|
||||||
if version == 1 or version == 2 then -- Original flat table format
|
if version == 1 or version == 2 then -- Original flat table format
|
||||||
local tables = minetest.deserialize(content, true)
|
local tables = minetest.deserialize(content, true)
|
||||||
|
|
|
@ -45,14 +45,14 @@ local function chatcommand_handler(cmd_name, name, param)
|
||||||
if def.nodes_needed then
|
if def.nodes_needed then
|
||||||
local count = def.nodes_needed(name, unpack(parsed))
|
local count = def.nodes_needed(name, unpack(parsed))
|
||||||
safe_region(name, count, function()
|
safe_region(name, count, function()
|
||||||
local success, msg = def.func(name, unpack(parsed))
|
local _, msg = def.func(name, unpack(parsed))
|
||||||
if msg then
|
if msg then
|
||||||
minetest.chat_send_player(name, msg)
|
minetest.chat_send_player(name, msg)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
-- no "safe region" check
|
-- no "safe region" check
|
||||||
local success, msg = def.func(name, unpack(parsed))
|
local _, msg = def.func(name, unpack(parsed))
|
||||||
if msg then
|
if msg then
|
||||||
minetest.chat_send_player(name, msg)
|
minetest.chat_send_player(name, msg)
|
||||||
end
|
end
|
||||||
|
@ -1382,7 +1382,7 @@ worldedit.register_command("restore", {
|
||||||
})
|
})
|
||||||
|
|
||||||
local function detect_misaligned_schematic(name, pos1, pos2)
|
local function detect_misaligned_schematic(name, pos1, pos2)
|
||||||
pos1, pos2 = worldedit.sort_pos(pos1, pos2)
|
pos1 = worldedit.sort_pos(pos1, pos2)
|
||||||
-- Check that allocate/save can position the schematic correctly
|
-- Check that allocate/save can position the schematic correctly
|
||||||
-- The expected behaviour is that the (0,0,0) corner of the schematic stays
|
-- The expected behaviour is that the (0,0,0) corner of the schematic stays
|
||||||
-- sat pos1, this only works when the minimum position is actually present
|
-- sat pos1, this only works when the minimum position is actually present
|
||||||
|
|
Loading…
Reference in New Issue
Block a user