fix: add proper type hint for bitfield

This commit is contained in:
əlemi 2023-03-13 23:42:51 +01:00
parent 9928ea7a46
commit 9567201129
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 4 additions and 2 deletions

View file

@ -8,7 +8,7 @@ from ....types import *
class PacketMultiBlockChange(Packet):
__slots__ = ( 'id', 'chunkCoordinates', 'chunkX', 'chunkZ', 'notTrustEdges', 'records', 'suppressLightUpdates' )
chunkCoordinates : bytes
chunkCoordinates : int
chunkX : int
chunkZ : int
notTrustEdges : bool
@ -16,7 +16,7 @@ class PacketMultiBlockChange(Packet):
suppressLightUpdates : bool
def __init__(self, proto:int,
chunkCoordinates:bytes=None,
chunkCoordinates:int=None,
chunkX:int=None,
chunkZ:int=None,
notTrustEdges:bool=None,

View file

@ -197,6 +197,8 @@ def mchint(slot_type:Any) -> Ref:
else:
possibilities.add(Ref('None'))
return Ref(f'Union[{", ".join(str(s) for s in sorted(possibilities))}]')
elif t == "bitfield":
return Ref('int')
# elif t == "mapper": # ????
# return TrailingData
logging.error("Unknown type %s, using 'bytes' as hint", str(slot_type))