Fix 1.17 snapshot restoration (#1632)

This commit is contained in:
Jordan 2022-02-27 22:20:16 +01:00 committed by GitHub
parent 081d8ddb50
commit dec0373081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,16 +98,15 @@ public class AnvilChunk17 implements Chunk {
ListBinaryTag sections = rootTag.getList("Sections");
for (BinaryTag rawSectionTag : sections) {
if (!(rawSectionTag instanceof CompoundBinaryTag)) {
if (!(rawSectionTag instanceof CompoundBinaryTag sectionTag)) {
continue;
}
CompoundBinaryTag sectionTag = (CompoundBinaryTag) rawSectionTag;
if (sectionTag.get("Y") == null || sectionTag.get("BlockStates") == null) {
continue; // Empty section.
}
int y = NbtUtils.getInt(tag, "Y");
int y = NbtUtils.getInt(sectionTag, "Y");
updateSectionIndexRange(y);
// parse palette