added int array support to nbt.py
(untested) Also removed an extra import that I forgot about earlier.
This commit is contained in:
@@ -85,6 +85,7 @@ class NBTFileReader(object):
|
||||
8: self._read_tag_string,
|
||||
9: self._read_tag_list,
|
||||
10:self._read_tag_compound,
|
||||
11:self._read_tag_int_array,
|
||||
}
|
||||
|
||||
# These private methods read the payload only of the following types
|
||||
@@ -121,6 +122,11 @@ class NBTFileReader(object):
|
||||
bytes = self._file.read(length)
|
||||
return bytes
|
||||
|
||||
def _read_tag_int_array(self):
|
||||
length = self._read_tag_int()
|
||||
int_bytes = self._file.read(length*4)
|
||||
return struct.unpack(">%ii" % length, int_bytes)
|
||||
|
||||
def _read_tag_string(self):
|
||||
length = self._read_tag_short()
|
||||
# Read the string
|
||||
|
||||
@@ -5,7 +5,6 @@ from collections import namedtuple
|
||||
|
||||
import rendermodes
|
||||
from world import UPPER_LEFT, UPPER_RIGHT, LOWER_LEFT, LOWER_RIGHT
|
||||
import logging
|
||||
|
||||
class ValidationException(Exception):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user