From dec0373081a3bba4b4caa9ab81770383d8cbbe7f Mon Sep 17 00:00:00 2001 From: Jordan Date: Sun, 27 Feb 2022 22:20:16 +0100 Subject: [PATCH] Fix 1.17 snapshot restoration (#1632) --- .../java/com/sk89q/worldedit/world/chunk/AnvilChunk17.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk17.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk17.java index 3eb4a47bc..a6fa95b53 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk17.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk17.java @@ -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