From 0fae8be8167312ece3b76f06fd9a36705f6048bc Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Fri, 8 Feb 2013 13:26:47 -0800 Subject: [PATCH] Cleaning up minor issue with the ChunkStore. --- .../blockmeta/chunkmeta/PrimitiveChunkStore.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java index d12362353..7db8f56e9 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/PrimitiveChunkStore.java @@ -178,16 +178,15 @@ public class PrimitiveChunkStore implements ChunkStore { } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - int fileVersionNumber; // Can be used to determine the format of the file - - long lsb = in.readLong(); - if (((int) (lsb >> 32)) == MAGIC_NUMBER) { - fileVersionNumber = (int) lsb; - lsb = in.readLong(); - } else { + int magic = in.readInt(); + // Can be used to determine the format of the file + int fileVersionNumber = in.readInt(); + + if (magic != MAGIC_NUMBER) { fileVersionNumber = 0; } + long lsb = in.readLong(); long msb = in.readLong(); worldUid = new UUID(msb, lsb); cx = in.readInt();