Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ private void readRemainingDataCache(Clipboard clipboard) throws IOException {
case CACHE_IDENTIFIER_BLOCK -> this.readPaletteData(cacheStream, this.getBlockWriter(clipboard));
case CACHE_IDENTIFIER_BIOMES -> this.readPaletteData(cacheStream, this.getBiomeWriter(clipboard));
case CACHE_IDENTIFIER_ENTITIES -> {
cacheStream.skipNBytes(1); // list child type (TAG_Compound)
this.readEntityContainers(
cacheStream,
cacheNbtIn,
Expand All @@ -251,7 +250,6 @@ private void readRemainingDataCache(Clipboard clipboard) throws IOException {
);
}
case CACHE_IDENTIFIER_BLOCK_TILE_ENTITIES -> {
cacheStream.skipNBytes(1); // list child type (TAG_Compound)
this.readEntityContainers(
cacheStream,
cacheNbtIn,
Expand Down Expand Up @@ -370,9 +368,6 @@ private void readEntities(@Nullable Clipboard target) throws IOException {
cacheStream.writeTagPayload(this.nbtInputStream.readTagPayload(NBTConstants.TYPE_LIST, 0));
return;
}
if (this.dataInputStream.read() != NBTConstants.TYPE_COMPOUND) {
throw new IOException("Expected a compound block for entity");
}
this.readEntityContainers(
this.dataInputStream, this.nbtInputStream, DataFixer.FixTypes.ENTITY, this.provideEntityTransformer(target)
);
Expand All @@ -392,9 +387,6 @@ private void readTileEntities(Clipboard target) throws IOException {
cacheStream.writeTagPayload(this.nbtInputStream.readTagPayload(NBTConstants.TYPE_LIST, 0));
return;
}
if (this.dataInputStream.read() != NBTConstants.TYPE_COMPOUND) {
throw new IOException("Expected a compound block for tile entity");
}
this.readEntityContainers(
this.dataInputStream,
this.nbtInputStream,
Expand All @@ -413,7 +405,13 @@ private void readEntityContainers(
LinCompoundTag tag;
String id;
byte type;

int listType = stream.read();
int count = stream.readInt();
if (count > 0 && listType != NBTConstants.TYPE_COMPOUND) {
throw new IOException("Expected a compound block for tile entity list");
}

while (count-- > 0) {
x = -1;
y = -1;
Expand Down
Loading