From c3009b46a8722396d9f45c27f0cd88001f09f12e Mon Sep 17 00:00:00 2001 From: Brady Date: Thu, 23 Aug 2018 20:09:40 -0500 Subject: [PATCH] End of file magic values are bad change my mind --- src/main/java/baritone/chunk/CachedRegion.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/baritone/chunk/CachedRegion.java b/src/main/java/baritone/chunk/CachedRegion.java index 385a206c..514d1b23 100644 --- a/src/main/java/baritone/chunk/CachedRegion.java +++ b/src/main/java/baritone/chunk/CachedRegion.java @@ -160,7 +160,6 @@ public final class CachedRegion implements IBlockTypeAccess { } } } - out.writeInt(~CACHED_REGION_MAGIC); } hasUnsavedChanges = false; System.out.println("Saved region successfully"); @@ -231,6 +230,8 @@ public final class CachedRegion implements IBlockTypeAccess { for (int x = 0; x < 32; x++) { if (tmpCached[x][z] != null) { // 16 * 16 * 256 = 65536 so a short is enough + // ^ haha jokes on leijurv, java doesn't have unsigned types so that isn't correct + // also ur gay if u have more than 32767 special blocks in a chunk short numSpecialBlockTypes = in.readShort(); for (int i = 0; i < numSpecialBlockTypes; i++) { String blockName = in.readUTF(); @@ -251,10 +252,6 @@ public final class CachedRegion implements IBlockTypeAccess { } } } - int fileEndMagic = in.readInt(); - if (fileEndMagic != ~magic) { - throw new IOException("Bad end of file magic"); - } // only if the entire file was uncorrupted do we actually set the chunks for (int x = 0; x < 32; x++) { for (int z = 0; z < 32; z++) {