Fix fast schematic reader/writer

- Have both sponge and fast r/w available but default to "fast"
 - Correctly "offset" entities in the schematic, and add a legacy mode for loading old FAWE schematics with entities required.
 - Lazily reading means it's read in order of appearance in the inputstream so we need to read schematic version first (skip past everything) and then reset the stream. Fixes #740
 - Add an FAWEVersion to the metadata
 - Correctly actually return a BlockArrayClipboard when required. Fixes #454
This commit is contained in:
dordsor21
2021-01-01 15:01:35 +00:00
parent 82f640d132
commit fbfe3221d7
8 changed files with 181 additions and 57 deletions

View File

@@ -147,7 +147,7 @@ public class SchematicCommands {
@Deprecated
@CommandPermissions({"worldedit.clipboard.load", "worldedit.schematic.load", "worldedit.schematic.load.web", "worldedit.schematic.load.asset"})
public void loadall(Player player, LocalSession session,
@Arg(desc = "Format name.", def = "schematic")
@Arg(desc = "Format name.", def = "fast")
String formatName,
@Arg(desc = "File name.")
String filename,
@@ -223,7 +223,7 @@ public class SchematicCommands {
public void load(Actor actor, LocalSession session,
@Arg(desc = "File name.")
String filename,
@Arg(desc = "Format name.", def = "sponge")
@Arg(desc = "Format name.", def = "fast")
String formatName) throws FilenameException {
LocalConfiguration config = worldEdit.getConfiguration();
@@ -323,7 +323,7 @@ public class SchematicCommands {
public void save(Actor actor, LocalSession session,
@Arg(desc = "File name.")
String filename,
@Arg(desc = "Format name.", def = "sponge")
@Arg(desc = "Format name.", def = "fast")
String formatName,
@Switch(name = 'f', desc = "Overwrite an existing file.")
boolean allowOverwrite,