End of file magic values are bad change my mind
This commit is contained in:
parent
e778a79a7b
commit
c3009b46a8
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user