mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-25 18:20:38 +01:00
Metadata fix for serialization.
This commit is contained in:
parent
65c218c3e2
commit
0317deb101
@ -47,6 +47,14 @@ worldedit.serialize = function(pos1, pos2) --wip: check for ItemStacks and wheth
|
|||||||
if node.name ~= "air" and node.name ~= "ignore" then
|
if node.name ~= "air" and node.name ~= "ignore" then
|
||||||
count = count + 1
|
count = count + 1
|
||||||
local meta = env:get_meta(pos):to_table()
|
local meta = env:get_meta(pos):to_table()
|
||||||
|
|
||||||
|
--convert metadata itemstacks to itemstrings
|
||||||
|
for name, inventory in pairs(meta.inventory) do
|
||||||
|
for index, stack in ipairs(inventory) do
|
||||||
|
inventory[index] = stack:to_string()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
result[count] = {
|
result[count] = {
|
||||||
x = pos.x - pos1.x,
|
x = pos.x - pos1.x,
|
||||||
y = pos.y - pos1.y,
|
y = pos.y - pos1.y,
|
||||||
|
Loading…
Reference in New Issue
Block a user