From f087c3ef715f560ab8e716d5a92cf7b894916b0f Mon Sep 17 00:00:00 2001 From: Anthony Zhang Date: Tue, 27 Nov 2012 19:29:10 -0500 Subject: [PATCH] Fix the missing command //suppress . --- worldedit/table serialize (WIP).lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 worldedit/table serialize (WIP).lua diff --git a/worldedit/table serialize (WIP).lua b/worldedit/table serialize (WIP).lua new file mode 100644 index 0000000..6947c0b --- /dev/null +++ b/worldedit/table serialize (WIP).lua @@ -0,0 +1,15 @@ +serialize_meta = function(pos) + local insert, format, concat = table.insert, string.format, table.concat + --wip: do recursive serialize + + local meta = env:get_meta(pos):to_table() + local fields = {} + for key, value in pairs(meta.fields) do + insert(fields, format("%q", key) .. format("%q", value)) + end + return concat(meta.inventory, ",") .. concat(fields) +end + +deserialize_meta = function(value) + --wip +end \ No newline at end of file