mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-04 21:33:43 +01:00
Ignore unknown nodes when loading in saves
This commit is contained in:
parent
f75700ed76
commit
469c3bf70b
@ -251,7 +251,9 @@ function worldedit.deserialize(origin_pos, value)
|
||||
|
||||
local origin_x, origin_y, origin_z = origin_pos.x, origin_pos.y, origin_pos.z
|
||||
local add_node, get_meta = minetest.add_node, minetest.get_meta
|
||||
local registered_nodes = minetest.registered_nodes
|
||||
for i, entry in ipairs(nodes) do
|
||||
if registered_nodes[entry.name] then
|
||||
entry.x, entry.y, entry.z = origin_x + entry.x, origin_y + entry.y, origin_z + entry.z
|
||||
-- Entry acts as both position and node
|
||||
add_node(entry, entry)
|
||||
@ -259,6 +261,7 @@ function worldedit.deserialize(origin_pos, value)
|
||||
get_meta(entry):from_table(entry.meta)
|
||||
end
|
||||
end
|
||||
end
|
||||
return #nodes
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user