fix: add proper type hint for bitfield
This commit is contained in:
parent
9928ea7a46
commit
9567201129
2 changed files with 4 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue