forked from SteamWar/SteamWar
Fixes...
This commit is contained in:
@@ -389,7 +389,7 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
|
|||||||
inputStream.close();
|
inputStream.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static class SpongeSchematicReader extends NBTSchematicReader {
|
public static class SpongeSchematicReader extends NBTSchematicReader {
|
||||||
|
|
||||||
private final NBTInputStream inputStream;
|
private final NBTInputStream inputStream;
|
||||||
private DataFixer fixer = null;
|
private DataFixer fixer = null;
|
||||||
@@ -420,7 +420,7 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
|
|||||||
dataVersion = 1631; // this is a relatively safe assumption unless someone imports a schematic from 1.12, e.g. sponge 7.1-
|
dataVersion = 1631; // this is a relatively safe assumption unless someone imports a schematic from 1.12, e.g. sponge 7.1-
|
||||||
fixer = platform.getDataFixer();
|
fixer = platform.getDataFixer();
|
||||||
return readVersion1(schematicTag);
|
return readVersion1(schematicTag);
|
||||||
} else if (schematicVersion == 2) {
|
} else if (schematicVersion == 2 || schematicVersion == 3) {
|
||||||
dataVersion = requireTag(schematic, "DataVersion", IntTag.class).getValue();
|
dataVersion = requireTag(schematic, "DataVersion", IntTag.class).getValue();
|
||||||
if (dataVersion < liveDataVersion) {
|
if (dataVersion < liveDataVersion) {
|
||||||
fixer = platform.getDataFixer();
|
fixer = platform.getDataFixer();
|
||||||
@@ -449,9 +449,6 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
|
|||||||
|
|
||||||
private CompoundTag getBaseTag() throws IOException {
|
private CompoundTag getBaseTag() throws IOException {
|
||||||
NamedTag rootTag = inputStream.readNamedTag();
|
NamedTag rootTag = inputStream.readNamedTag();
|
||||||
if (!rootTag.getName().equals("Schematic")) {
|
|
||||||
throw new IOException("Tag 'Schematic' does not exist or is not first");
|
|
||||||
}
|
|
||||||
CompoundTag schematicTag = (CompoundTag) rootTag.getTag();
|
CompoundTag schematicTag = (CompoundTag) rootTag.getTag();
|
||||||
|
|
||||||
// Check
|
// Check
|
||||||
@@ -460,6 +457,8 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
|
|||||||
if (schematic.size() == 1) {
|
if (schematic.size() == 1) {
|
||||||
schematicTag = requireTag(schematic, "Schematic", CompoundTag.class);
|
schematicTag = requireTag(schematic, "Schematic", CompoundTag.class);
|
||||||
schematic = schematicTag.getValue();
|
schematic = schematicTag.getValue();
|
||||||
|
} else if (!rootTag.getName().equals("Schematic")) {
|
||||||
|
throw new IOException("Tag 'Schematic' does not exist or is not first");
|
||||||
}
|
}
|
||||||
|
|
||||||
schematicVersion = requireTag(schematic, "Version", IntTag.class).getValue();
|
schematicVersion = requireTag(schematic, "Version", IntTag.class).getValue();
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ public class WorldEditWrapper18 extends WorldEditWrapper14 {
|
|||||||
case MCEDIT:
|
case MCEDIT:
|
||||||
return new MCEditSchematicReader(nbtStream).read();
|
return new MCEditSchematicReader(nbtStream).read();
|
||||||
case SPONGE_V2:
|
case SPONGE_V2:
|
||||||
return new SpongeSchematicReader(nbtStream).read();
|
case SPONGE_V3:
|
||||||
|
return new WorldEditWrapper14.SpongeSchematicReader(nbtStream).read();
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException("Unsupported schematic format");
|
throw new IllegalArgumentException("Unsupported schematic format");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user