0

nbt timestamps are probably signed (like time_t)

Besides, we get overflow errors with utime on windows for large
unsigned 32-bit integers.
This commit is contained in:
Aaron Griffith
2013-05-06 18:11:45 -03:00
parent 0f017f6b51
commit 6e3556ab12

View File

@@ -199,7 +199,8 @@ class MCRFileReader(object):
listing chunks contained in the file.
"""
_table_format = struct.Struct(">1024I")
_location_table_format = struct.Struct(">1024I")
_timestamp_table_format = struct.Struct(">1024i")
_chunk_header_format = struct.Struct(">I B")
def __init__(self, fileobj):
@@ -217,8 +218,8 @@ class MCRFileReader(object):
raise CorruptRegionError("invalid timestamp table")
# turn this data into a useful list
self._locations = self._table_format.unpack(location_data)
self._timestamps = self._table_format.unpack(timestamp_data)
self._locations = self._location_table_format.unpack(location_data)
self._timestamps = self._timestamp_table_format.unpack(timestamp_data)
def close(self):
"""Close the region file and free any resources associated