mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 19:36:41 +00:00
Better logic for selecting schematic format.
- You had to specifically use //schem load <schematic>.schematic mcedit to load legacy schematics, now if you're loading .schematic it assumes you're wanting mcedit format - If you end up attempting to load an mcedit schematic with the sponge reader it now throws an exception.
This commit is contained in:
@ -69,6 +69,7 @@ public class FastSchematicReader extends NBTSchematicReader {
|
||||
private final NBTInputStream inputStream;
|
||||
private DataFixer fixer = null;
|
||||
private int dataVersion = -1;
|
||||
private int version = -1;
|
||||
|
||||
private FastByteArrayOutputStream blocksOut;
|
||||
private FaweOutputStream blocks;
|
||||
@ -119,6 +120,7 @@ public class FastSchematicReader extends NBTSchematicReader {
|
||||
StreamDelegate root = new StreamDelegate();
|
||||
StreamDelegate schematic = root.add("Schematic");
|
||||
schematic.add("DataVersion").withInt((i, v) -> dataVersion = v);
|
||||
schematic.add("Version").withInt((i, v) -> version = v);
|
||||
schematic.add("Width").withInt((i, v) -> width = v);
|
||||
schematic.add("Height").withInt((i, v) -> height = v);
|
||||
schematic.add("Length").withInt((i, v) -> length = v);
|
||||
@ -196,6 +198,11 @@ public class FastSchematicReader extends NBTSchematicReader {
|
||||
public Clipboard read(UUID uuid, Function<BlockVector3, Clipboard> createOutput) throws IOException {
|
||||
StreamDelegate root = createDelegate();
|
||||
inputStream.readNamedTagLazy(root);
|
||||
|
||||
if (version != 1 && version != 2) {
|
||||
throw new IOException("This schematic version is currently not supported");
|
||||
}
|
||||
|
||||
if (blocks != null) blocks.close();
|
||||
if (biomes != null) biomes.close();
|
||||
blocks = null;
|
||||
|
Reference in New Issue
Block a user