Chunk: allow Chunks with empty Sections tag

This commit is contained in:
Matthias Schiffer 2019-05-25 16:57:24 +02:00
parent 3c92f58110
commit fb097cbb79
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C

View file

@ -1,5 +1,5 @@
/*
Copyright (c) 2015-2018, Matthias Schiffer <mschiffer@universe-factory.net>
Copyright (c) 2015-2019, Matthias Schiffer <mschiffer@universe-factory.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@ Chunk::Chunk(const ChunkData *data) {
level = assertValue(data->getRoot().get<NBT::CompoundTag>("Level"));
std::shared_ptr<const NBT::ListTag> sectionsTag = level->get<NBT::ListTag>("Sections");
if (!sectionsTag)
if (!sectionsTag || sectionsTag->empty())
return;
biomeBytes = level->get<NBT::ByteArrayTag>("Biomes");