1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2024-11-01 00:00:17 +01:00

Metadata fix for serialization.

This commit is contained in:
Anthony Zhang 2013-03-27 18:07:52 -04:00
parent 65c218c3e2
commit 0317deb101

View File

@ -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,