mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Correct tag name for writing and add compatibilty for created corrupt schematics
This commit is contained in:
parent
9c34702a47
commit
cf750ba00c
@ -157,6 +157,10 @@ public class FastSchematicReader extends NBTSchematicReader {
|
||||
tilesDelegate.withInfo((length, type) -> tiles = new ArrayList<>(length));
|
||||
tilesDelegate.withElem((ValueReader<Map<String, Object>>) (index, tile) -> tiles.add(tile));
|
||||
|
||||
StreamDelegate compatTilesDelegate = schematic.add("TileEntities");
|
||||
compatTilesDelegate.withInfo((length, type) -> tiles = new ArrayList<>(length));
|
||||
compatTilesDelegate.withElem((ValueReader<Map<String, Object>>) (index, tile) -> tiles.add(tile));
|
||||
|
||||
StreamDelegate entitiesDelegate = schematic.add("Entities");
|
||||
entitiesDelegate.withInfo((length, type) -> entities = new ArrayList<>(length));
|
||||
entitiesDelegate.withElem((ValueReader<Map<String, Object>>) (index, entity) -> entities.add(entity));
|
||||
|
@ -210,14 +210,14 @@ public class FastSchematicWriter implements ClipboardWriter {
|
||||
}
|
||||
|
||||
if (numTiles != 0) {
|
||||
out.writeNamedTagName("TileEntities", NBTConstants.TYPE_LIST);
|
||||
out.writeNamedTagName("BlockEntities", NBTConstants.TYPE_LIST);
|
||||
rawStream.write(NBTConstants.TYPE_COMPOUND);
|
||||
rawStream.writeInt(numTiles);
|
||||
try (LZ4BlockInputStream in = new LZ4BlockInputStream(new ByteArrayInputStream(tilesCompressed.toByteArray()))) {
|
||||
IOUtil.copy(in, rawStream);
|
||||
}
|
||||
} else {
|
||||
out.writeNamedEmptyList("TileEntities");
|
||||
out.writeNamedEmptyList("BlockEntities");
|
||||
}
|
||||
|
||||
if (finalClipboard.hasBiomes()) {
|
||||
|
Loading…
Reference in New Issue
Block a user