Allow new NBT type 12 (long array) to be read
This commit is contained in:
@@ -98,6 +98,7 @@ class NBTFileReader(object):
|
|||||||
9: self._read_tag_list,
|
9: self._read_tag_list,
|
||||||
10:self._read_tag_compound,
|
10:self._read_tag_compound,
|
||||||
11:self._read_tag_int_array,
|
11:self._read_tag_int_array,
|
||||||
|
12:self._read_tag_long_array,
|
||||||
}
|
}
|
||||||
|
|
||||||
# These private methods read the payload only of the following types
|
# These private methods read the payload only of the following types
|
||||||
@@ -139,6 +140,11 @@ class NBTFileReader(object):
|
|||||||
int_bytes = self._file.read(length*4)
|
int_bytes = self._file.read(length*4)
|
||||||
return struct.unpack(">%ii" % length, int_bytes)
|
return struct.unpack(">%ii" % length, int_bytes)
|
||||||
|
|
||||||
|
def _read_tag_long_array(self):
|
||||||
|
length = self._uint.unpack(self._file.read(4))[0]
|
||||||
|
long_bytes = self._file.read(length*8)
|
||||||
|
return struct.unpack(">%iq" % length, long_bytes)
|
||||||
|
|
||||||
def _read_tag_string(self):
|
def _read_tag_string(self):
|
||||||
length = self._ushort.unpack(self._file.read(2))[0]
|
length = self._ushort.unpack(self._file.read(2))[0]
|
||||||
# Read the string
|
# Read the string
|
||||||
|
|||||||
Reference in New Issue
Block a user