hinted slot as Item

This commit is contained in:
əlemi 2022-01-19 01:21:02 +01:00
parent c64f527ec7
commit 15801426b0
9 changed files with 19 additions and 19 deletions

View file

@ -10,13 +10,13 @@ class PacketEntityEquipment(Packet):
entityId : int entityId : int
equipments : bytes equipments : bytes
item : dict item : Item
slot : int slot : int
def __init__(self, proto:int, def __init__(self, proto:int,
entityId:int=None, entityId:int=None,
equipments:bytes=None, equipments:bytes=None,
item:dict=None, item:Item=None,
slot:int=None, slot:int=None,
**kwargs **kwargs
): ):

View file

@ -8,13 +8,13 @@ from ....types import *
class PacketSetSlot(Packet): class PacketSetSlot(Packet):
__slots__ = ( 'id', 'item', 'slot', 'stateId', 'windowId' ) __slots__ = ( 'id', 'item', 'slot', 'stateId', 'windowId' )
item : dict item : Item
slot : int slot : int
stateId : int stateId : int
windowId : int windowId : int
def __init__(self, proto:int, def __init__(self, proto:int,
item:dict=None, item:Item=None,
slot:int=None, slot:int=None,
stateId:int=None, stateId:int=None,
windowId:int=None, windowId:int=None,

View file

@ -8,13 +8,13 @@ from ....types import *
class PacketWindowItems(Packet): class PacketWindowItems(Packet):
__slots__ = ( 'id', 'carriedItem', 'items', 'stateId', 'windowId' ) __slots__ = ( 'id', 'carriedItem', 'items', 'stateId', 'windowId' )
carriedItem : dict carriedItem : Item
items : list items : list
stateId : int stateId : int
windowId : int windowId : int
def __init__(self, proto:int, def __init__(self, proto:int,
carriedItem:dict=None, carriedItem:Item=None,
items:list=None, items:list=None,
stateId:int=None, stateId:int=None,
windowId:int=None, windowId:int=None,

View file

@ -8,7 +8,7 @@ from ....types import *
class PacketWorldParticles(Packet): class PacketWorldParticles(Packet):
__slots__ = ( 'id', 'data', 'longDistance', 'offsetX', 'offsetY', 'offsetZ', 'particleData', 'particleId', 'particles', 'x', 'y', 'z' ) __slots__ = ( 'id', 'data', 'longDistance', 'offsetX', 'offsetY', 'offsetZ', 'particleData', 'particleId', 'particles', 'x', 'y', 'z' )
data : Union[Union[None, dict, int],Union[None, list],bytes] data : Union[Union[Item, None, int],Union[None, list],bytes]
longDistance : bool longDistance : bool
offsetX : float offsetX : float
offsetY : float offsetY : float
@ -21,7 +21,7 @@ class PacketWorldParticles(Packet):
z : float z : float
def __init__(self, proto:int, def __init__(self, proto:int,
data:Union[Union[None, dict, int],Union[None, list],bytes]=None, data:Union[Union[Item, None, int],Union[None, list],bytes]=None,
longDistance:bool=None, longDistance:bool=None,
offsetX:float=None, offsetX:float=None,
offsetY:float=None, offsetY:float=None,

View file

@ -13,7 +13,7 @@ class PacketBlockPlace(Packet):
cursorZ : Union[float,int] cursorZ : Union[float,int]
direction : int direction : int
hand : int hand : int
heldItem : dict heldItem : Item
insideBlock : bool insideBlock : bool
location : tuple location : tuple
@ -23,7 +23,7 @@ class PacketBlockPlace(Packet):
cursorZ:Union[float,int]=None, cursorZ:Union[float,int]=None,
direction:int=None, direction:int=None,
hand:int=None, hand:int=None,
heldItem:dict=None, heldItem:Item=None,
insideBlock:bool=None, insideBlock:bool=None,
location:tuple=None, location:tuple=None,
**kwargs **kwargs

View file

@ -9,14 +9,14 @@ class PacketEditBook(Packet):
__slots__ = ( 'id', 'hand', 'new_book', 'pages', 'signing', 'title' ) __slots__ = ( 'id', 'hand', 'new_book', 'pages', 'signing', 'title' )
hand : int hand : int
new_book : dict new_book : Item
pages : list pages : list
signing : bool signing : bool
title : tuple title : tuple
def __init__(self, proto:int, def __init__(self, proto:int,
hand:int=None, hand:int=None,
new_book:dict=None, new_book:Item=None,
pages:list=None, pages:list=None,
signing:bool=None, signing:bool=None,
title:tuple=None, title:tuple=None,

View file

@ -8,11 +8,11 @@ from ....types import *
class PacketSetCreativeSlot(Packet): class PacketSetCreativeSlot(Packet):
__slots__ = ( 'id', 'item', 'slot' ) __slots__ = ( 'id', 'item', 'slot' )
item : dict item : Item
slot : int slot : int
def __init__(self, proto:int, def __init__(self, proto:int,
item:dict=None, item:Item=None,
slot:int=None, slot:int=None,
**kwargs **kwargs
): ):

View file

@ -10,8 +10,8 @@ class PacketWindowClick(Packet):
action : int action : int
changedSlots : list changedSlots : list
cursorItem : dict cursorItem : Item
item : dict item : Item
mode : int mode : int
mouseButton : int mouseButton : int
slot : int slot : int
@ -21,8 +21,8 @@ class PacketWindowClick(Packet):
def __init__(self, proto:int, def __init__(self, proto:int,
action:int=None, action:int=None,
changedSlots:list=None, changedSlots:list=None,
cursorItem:dict=None, cursorItem:Item=None,
item:dict=None, item:Item=None,
mode:int=None, mode:int=None,
mouseButton:int=None, mouseButton:int=None,
slot:int=None, slot:int=None,

View file

@ -111,7 +111,7 @@ HINT_MAP = {
"string": 'str', "string": 'str',
"nbt": 'dict', "nbt": 'dict',
"optionalNbt": 'Optional[dict]', "optionalNbt": 'Optional[dict]',
"slot": 'dict', "slot": 'Item',
"position": 'tuple', "position": 'tuple',
"entityMetadata": 'dict', "entityMetadata": 'dict',
"restBuffer": 'bytes', "restBuffer": 'bytes',