diff options
author | Anthony Zhang <azhang9@gmail.com> | 2012-11-27 19:29:10 -0500 |
---|---|---|
committer | Anthony Zhang <azhang9@gmail.com> | 2012-11-27 19:29:10 -0500 |
commit | f087c3ef715f560ab8e716d5a92cf7b894916b0f (patch) | |
tree | 967ea7eb24e95c286273f449bbafc89d8fc42806 | |
parent | 426dfb0bc38bdd85febc809d49b793c0489fa611 (diff) |
Fix the missing command //suppress <node>.
-rw-r--r-- | worldedit/table serialize (WIP).lua | 15 |
1 files changed, 15 insertions, 0 deletions
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 |