Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 02:50:05 +01:00
Correct tag name for writing and add compatibilty for created corrupt schematics
Dieser Commit ist enthalten in:
Ursprung
9c34702a47
Commit
cf750ba00c
@ -157,6 +157,10 @@ public class FastSchematicReader extends NBTSchematicReader {
|
|||||||
tilesDelegate.withInfo((length, type) -> tiles = new ArrayList<>(length));
|
tilesDelegate.withInfo((length, type) -> tiles = new ArrayList<>(length));
|
||||||
tilesDelegate.withElem((ValueReader<Map<String, Object>>) (index, tile) -> tiles.add(tile));
|
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");
|
StreamDelegate entitiesDelegate = schematic.add("Entities");
|
||||||
entitiesDelegate.withInfo((length, type) -> entities = new ArrayList<>(length));
|
entitiesDelegate.withInfo((length, type) -> entities = new ArrayList<>(length));
|
||||||
entitiesDelegate.withElem((ValueReader<Map<String, Object>>) (index, entity) -> entities.add(entity));
|
entitiesDelegate.withElem((ValueReader<Map<String, Object>>) (index, entity) -> entities.add(entity));
|
||||||
|
@ -210,14 +210,14 @@ public class FastSchematicWriter implements ClipboardWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (numTiles != 0) {
|
if (numTiles != 0) {
|
||||||
out.writeNamedTagName("TileEntities", NBTConstants.TYPE_LIST);
|
out.writeNamedTagName("BlockEntities", NBTConstants.TYPE_LIST);
|
||||||
rawStream.write(NBTConstants.TYPE_COMPOUND);
|
rawStream.write(NBTConstants.TYPE_COMPOUND);
|
||||||
rawStream.writeInt(numTiles);
|
rawStream.writeInt(numTiles);
|
||||||
try (LZ4BlockInputStream in = new LZ4BlockInputStream(new ByteArrayInputStream(tilesCompressed.toByteArray()))) {
|
try (LZ4BlockInputStream in = new LZ4BlockInputStream(new ByteArrayInputStream(tilesCompressed.toByteArray()))) {
|
||||||
IOUtil.copy(in, rawStream);
|
IOUtil.copy(in, rawStream);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
out.writeNamedEmptyList("TileEntities");
|
out.writeNamedEmptyList("BlockEntities");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (finalClipboard.hasBiomes()) {
|
if (finalClipboard.hasBiomes()) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren