Implemented new Anvil saving format, fixed old chunk saving format.

- Added 'Chunk' Interface.
 - Moved old 'Chunk' to 'OldChunk' and replaced dynamic world height reference with '128.
 - Added 'AnvilChunk' implementing the new anvil chunk format.
 - Added temp fixes to FileMcRegionChunkStore.java, TrueZipMcRegionChunkStore.java and ZippedMcRegionChunkStore.java too allow them to read .mca files.
 - Added the new 'IntArrayTag' since the new heightmap tag wasn't recognized.
 - Moved 'getChildTag' to 'NBTUtils'.
This commit is contained in:
Meaglin
2012-03-05 07:05:17 +01:00
committed by TomyLobo
parent 19b353f6b5
commit 8aabfb0c67
17 changed files with 647 additions and 253 deletions

View File

@@ -157,6 +157,8 @@ public final class NBTOutputStream implements Closeable {
case NBTConstants.TYPE_COMPOUND:
writeCompoundTagPayload((CompoundTag) tag);
break;
case NBTConstants.TYPE_INT_ARRAY:
writeIntArrayTagPayload((IntArrayTag) tag);
default:
throw new IOException("Invalid tag type: " + type + ".");
}
@@ -308,6 +310,14 @@ public final class NBTOutputStream implements Closeable {
private void writeEndTagPayload(EndTag tag) {
/* empty */
}
private void writeIntArrayTagPayload(IntArrayTag tag) throws IOException {
int[] data = tag.getValue();
os.writeInt(data.length);
for (int i = 0; i < data.length; i++) {
os.writeInt(data[i]);
}
}
public void close() throws IOException {
os.close();