Fix passing unsigned longs to TAG_Long, which requires signed longs
This commit is contained in:
parent
07edbc8798
commit
78b6ebf9eb
@ -119,11 +119,16 @@ class NBTUUIDAttr(object):
|
|||||||
least = uuidInt & 0xffffffffffffffffL
|
least = uuidInt & 0xffffffffffffffffL
|
||||||
most = (uuidInt >> 64) & 0xffffffffffffffffL
|
most = (uuidInt >> 64) & 0xffffffffffffffffL
|
||||||
tag = instance.rootTag
|
tag = instance.rootTag
|
||||||
tag["UUIDLeast"].value = least
|
tag["UUIDLeast"].value = _signed(least)
|
||||||
tag["UUIDMost"].value = most
|
tag["UUIDMost"].value = _signed(most)
|
||||||
instance.dirty = True
|
instance.dirty = True
|
||||||
|
|
||||||
|
|
||||||
|
def _signed(bits):
|
||||||
|
if bits >= (1 << 63):
|
||||||
|
bits -= (1 << 64)
|
||||||
|
return bits
|
||||||
|
|
||||||
class NBTCompoundRef(object):
|
class NBTCompoundRef(object):
|
||||||
def __init__(self, rootTag, parent):
|
def __init__(self, rootTag, parent):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user