From 15801426b0ac25d941b0ce6b5d404898788ead41 Mon Sep 17 00:00:00 2001 From: alemidev Date: Wed, 19 Jan 2022 01:21:02 +0100 Subject: [PATCH] hinted slot as Item --- .../mc/proto/play/clientbound/packet_entity_equipment.py | 4 ++-- aiocraft/mc/proto/play/clientbound/packet_set_slot.py | 4 ++-- aiocraft/mc/proto/play/clientbound/packet_window_items.py | 4 ++-- .../mc/proto/play/clientbound/packet_world_particles.py | 4 ++-- aiocraft/mc/proto/play/serverbound/packet_block_place.py | 4 ++-- aiocraft/mc/proto/play/serverbound/packet_edit_book.py | 4 ++-- .../mc/proto/play/serverbound/packet_set_creative_slot.py | 4 ++-- aiocraft/mc/proto/play/serverbound/packet_window_click.py | 8 ++++---- compiler/proto.py | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/aiocraft/mc/proto/play/clientbound/packet_entity_equipment.py b/aiocraft/mc/proto/play/clientbound/packet_entity_equipment.py index 9d05c0b..33b904d 100644 --- a/aiocraft/mc/proto/play/clientbound/packet_entity_equipment.py +++ b/aiocraft/mc/proto/play/clientbound/packet_entity_equipment.py @@ -10,13 +10,13 @@ class PacketEntityEquipment(Packet): entityId : int equipments : bytes - item : dict + item : Item slot : int def __init__(self, proto:int, entityId:int=None, equipments:bytes=None, - item:dict=None, + item:Item=None, slot:int=None, **kwargs ): diff --git a/aiocraft/mc/proto/play/clientbound/packet_set_slot.py b/aiocraft/mc/proto/play/clientbound/packet_set_slot.py index 8866a52..3b8655d 100644 --- a/aiocraft/mc/proto/play/clientbound/packet_set_slot.py +++ b/aiocraft/mc/proto/play/clientbound/packet_set_slot.py @@ -8,13 +8,13 @@ from ....types import * class PacketSetSlot(Packet): __slots__ = ( 'id', 'item', 'slot', 'stateId', 'windowId' ) - item : dict + item : Item slot : int stateId : int windowId : int def __init__(self, proto:int, - item:dict=None, + item:Item=None, slot:int=None, stateId:int=None, windowId:int=None, diff --git a/aiocraft/mc/proto/play/clientbound/packet_window_items.py b/aiocraft/mc/proto/play/clientbound/packet_window_items.py index e9c21d1..cc74b41 100644 --- a/aiocraft/mc/proto/play/clientbound/packet_window_items.py +++ b/aiocraft/mc/proto/play/clientbound/packet_window_items.py @@ -8,13 +8,13 @@ from ....types import * class PacketWindowItems(Packet): __slots__ = ( 'id', 'carriedItem', 'items', 'stateId', 'windowId' ) - carriedItem : dict + carriedItem : Item items : list stateId : int windowId : int def __init__(self, proto:int, - carriedItem:dict=None, + carriedItem:Item=None, items:list=None, stateId:int=None, windowId:int=None, diff --git a/aiocraft/mc/proto/play/clientbound/packet_world_particles.py b/aiocraft/mc/proto/play/clientbound/packet_world_particles.py index 7b95350..156f262 100644 --- a/aiocraft/mc/proto/play/clientbound/packet_world_particles.py +++ b/aiocraft/mc/proto/play/clientbound/packet_world_particles.py @@ -8,7 +8,7 @@ from ....types import * class PacketWorldParticles(Packet): __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 offsetX : float offsetY : float @@ -21,7 +21,7 @@ class PacketWorldParticles(Packet): z : float 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, offsetX:float=None, offsetY:float=None, diff --git a/aiocraft/mc/proto/play/serverbound/packet_block_place.py b/aiocraft/mc/proto/play/serverbound/packet_block_place.py index 7ec3e66..5f77bcf 100644 --- a/aiocraft/mc/proto/play/serverbound/packet_block_place.py +++ b/aiocraft/mc/proto/play/serverbound/packet_block_place.py @@ -13,7 +13,7 @@ class PacketBlockPlace(Packet): cursorZ : Union[float,int] direction : int hand : int - heldItem : dict + heldItem : Item insideBlock : bool location : tuple @@ -23,7 +23,7 @@ class PacketBlockPlace(Packet): cursorZ:Union[float,int]=None, direction:int=None, hand:int=None, - heldItem:dict=None, + heldItem:Item=None, insideBlock:bool=None, location:tuple=None, **kwargs diff --git a/aiocraft/mc/proto/play/serverbound/packet_edit_book.py b/aiocraft/mc/proto/play/serverbound/packet_edit_book.py index ac9777f..66c8f3c 100644 --- a/aiocraft/mc/proto/play/serverbound/packet_edit_book.py +++ b/aiocraft/mc/proto/play/serverbound/packet_edit_book.py @@ -9,14 +9,14 @@ class PacketEditBook(Packet): __slots__ = ( 'id', 'hand', 'new_book', 'pages', 'signing', 'title' ) hand : int - new_book : dict + new_book : Item pages : list signing : bool title : tuple def __init__(self, proto:int, hand:int=None, - new_book:dict=None, + new_book:Item=None, pages:list=None, signing:bool=None, title:tuple=None, diff --git a/aiocraft/mc/proto/play/serverbound/packet_set_creative_slot.py b/aiocraft/mc/proto/play/serverbound/packet_set_creative_slot.py index 1fabf63..21cea09 100644 --- a/aiocraft/mc/proto/play/serverbound/packet_set_creative_slot.py +++ b/aiocraft/mc/proto/play/serverbound/packet_set_creative_slot.py @@ -8,11 +8,11 @@ from ....types import * class PacketSetCreativeSlot(Packet): __slots__ = ( 'id', 'item', 'slot' ) - item : dict + item : Item slot : int def __init__(self, proto:int, - item:dict=None, + item:Item=None, slot:int=None, **kwargs ): diff --git a/aiocraft/mc/proto/play/serverbound/packet_window_click.py b/aiocraft/mc/proto/play/serverbound/packet_window_click.py index ecb02a2..2e661de 100644 --- a/aiocraft/mc/proto/play/serverbound/packet_window_click.py +++ b/aiocraft/mc/proto/play/serverbound/packet_window_click.py @@ -10,8 +10,8 @@ class PacketWindowClick(Packet): action : int changedSlots : list - cursorItem : dict - item : dict + cursorItem : Item + item : Item mode : int mouseButton : int slot : int @@ -21,8 +21,8 @@ class PacketWindowClick(Packet): def __init__(self, proto:int, action:int=None, changedSlots:list=None, - cursorItem:dict=None, - item:dict=None, + cursorItem:Item=None, + item:Item=None, mode:int=None, mouseButton:int=None, slot:int=None, diff --git a/compiler/proto.py b/compiler/proto.py index bff7b4a..a86e023 100644 --- a/compiler/proto.py +++ b/compiler/proto.py @@ -111,7 +111,7 @@ HINT_MAP = { "string": 'str', "nbt": 'dict', "optionalNbt": 'Optional[dict]', - "slot": 'dict', + "slot": 'Item', "position": 'tuple', "entityMetadata": 'dict', "restBuffer": 'bytes',