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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user