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):
|
class PacketMultiBlockChange(Packet):
|
||||||
__slots__ = ( 'id', 'chunkCoordinates', 'chunkX', 'chunkZ', 'notTrustEdges', 'records', 'suppressLightUpdates' )
|
__slots__ = ( 'id', 'chunkCoordinates', 'chunkX', 'chunkZ', 'notTrustEdges', 'records', 'suppressLightUpdates' )
|
||||||
|
|
||||||
chunkCoordinates : bytes
|
chunkCoordinates : int
|
||||||
chunkX : int
|
chunkX : int
|
||||||
chunkZ : int
|
chunkZ : int
|
||||||
notTrustEdges : bool
|
notTrustEdges : bool
|
||||||
|
@ -16,7 +16,7 @@ class PacketMultiBlockChange(Packet):
|
||||||
suppressLightUpdates : bool
|
suppressLightUpdates : bool
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self, proto:int,
|
||||||
chunkCoordinates:bytes=None,
|
chunkCoordinates:int=None,
|
||||||
chunkX:int=None,
|
chunkX:int=None,
|
||||||
chunkZ:int=None,
|
chunkZ:int=None,
|
||||||
notTrustEdges:bool=None,
|
notTrustEdges:bool=None,
|
||||||
|
|
|
@ -197,6 +197,8 @@ def mchint(slot_type:Any) -> Ref:
|
||||||
else:
|
else:
|
||||||
possibilities.add(Ref('None'))
|
possibilities.add(Ref('None'))
|
||||||
return Ref(f'Union[{", ".join(str(s) for s in sorted(possibilities))}]')
|
return Ref(f'Union[{", ".join(str(s) for s in sorted(possibilities))}]')
|
||||||
|
elif t == "bitfield":
|
||||||
|
return Ref('int')
|
||||||
# elif t == "mapper": # ????
|
# elif t == "mapper": # ????
|
||||||
# return TrailingData
|
# return TrailingData
|
||||||
logging.error("Unknown type %s, using 'bytes' as hint", str(slot_type))
|
logging.error("Unknown type %s, using 'bytes' as hint", str(slot_type))
|
||||||
|
|
Loading…
Reference in a new issue