From 796aa3870d5cd45696cb253024aa75e8bbc2b462 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 24 Oct 2014 15:01:46 -0400 Subject: Clean up serialization * Adds a header to serialized data (to make version checking sane). * Removes the duplicate deserialization for `worldedit.deserialize` and `worldedit.allocate`. * Optimizes `worldedit.deserialize` by only deserializing the data once. * Makes some fields optional. * Cleans up the comments and a little of the code style. --- README.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 224059e..7d3077b 100644 --- a/README.md +++ b/README.md @@ -109,20 +109,24 @@ WorldEdit supports two different types of schematics. The first is the WorldEdit Schematic format, with the file extension ".we", and in some older versions, ".wem". There have been several previous versions of the WorldEdit Schematic format, but WorldEdit is capable of loading any past versions, and will always support them - there is no need to worry about schematics becoming obselete. -The current version of the WorldEdit Schematic format, internally known as version 4, is essentially an array of node data tables in Lua 5.2 table syntax. Specifically: - - return { - { - ["y"] = , - ["x"] = , - ["name"] = , - ["z"] = , - ["meta"] = , - ["param2"] = , - ["param1"] = , - }, - <...> - } +As of version 5, WorldEdit schematics include a header. The header is seperated from the content by a colon (`:`). It contains fields seperated by commas (`,`). Currently only one field is used, which contains the version in ASCII decimal. + +The current version of the WorldEdit Schematic format is essentially an array of node data tables in Lua 5.1 table syntax preceded by a header. +Specifically it looks like this: + + 5:return { + { + y = , + x = , + z = , + name = , + param1 = , + param2 = , + meta = , + }, + <...> + } + The ordering of the values and minor aspects of the syntax, such as trailing commas or newlines, are not guaranteed to stay the same in future versions. -- cgit v1.2.3