diff options
author | Anthony Zhang <azhang9@gmail.com> | 2013-03-27 18:07:52 -0400 |
---|---|---|
committer | Anthony Zhang <azhang9@gmail.com> | 2013-03-27 18:07:52 -0400 |
commit | 0317deb10143bd59a78fcba8b0334ffec877e0c7 (patch) | |
tree | dfc10a024eb01f14a9581a895d992ddca354cf0b /worldedit/serialization.lua | |
parent | 65c218c3e2b6fbac804af6b04b633574a64e5d9c (diff) |
Metadata fix for serialization.
Diffstat (limited to 'worldedit/serialization.lua')
-rw-r--r-- | worldedit/serialization.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/worldedit/serialization.lua b/worldedit/serialization.lua index c876261..cc3297e 100644 --- a/worldedit/serialization.lua +++ b/worldedit/serialization.lua @@ -47,6 +47,14 @@ worldedit.serialize = function(pos1, pos2) --wip: check for ItemStacks and wheth if node.name ~= "air" and node.name ~= "ignore" then
count = count + 1
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] = {
x = pos.x - pos1.x,
y = pos.y - pos1.y,
|