From f052c91cda5f5c4bbfcf38eaed085df92750d29b Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 26 Aug 2018 12:54:01 -0700 Subject: [PATCH] map 0 to 65536 --- src/main/java/baritone/chunk/CachedRegion.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/baritone/chunk/CachedRegion.java b/src/main/java/baritone/chunk/CachedRegion.java index d4a25834..0fbe8b4e 100644 --- a/src/main/java/baritone/chunk/CachedRegion.java +++ b/src/main/java/baritone/chunk/CachedRegion.java @@ -239,6 +239,10 @@ public final class CachedRegion implements IBlockTypeAccess { List locs = new ArrayList<>(); location[x][z].put(blockName, locs); int numLocations = in.readShort() & 0xffff; + if (numLocations == 0) { + // an entire chunk full of air can happen in the end + numLocations = 65536; + } for (int j = 0; j < numLocations; j++) { byte xz = in.readByte(); int X = xz & 0x0f;