This commit is contained in:
əlemi 2021-12-02 20:15:57 +01:00
parent 45daee5aa8
commit 4ebd19793e

View file

@ -5,7 +5,7 @@ import keyword
import logging import logging
from pathlib import Path from pathlib import Path
from typing import List, Dict, Union from typing import List, Dict, Union, Type as Class
from aiocraft.mc.types import * from aiocraft.mc.types import *
@ -52,7 +52,7 @@ TYPE_MAP = {
"entityMetadata": EntityMetadata, "entityMetadata": EntityMetadata,
} }
def mctype(slot_type:Any) -> Type: def mctype(slot_type:Any) -> Class[Type]:
if isinstance(slot_type, str) and slot_type in TYPE_MAP: if isinstance(slot_type, str) and slot_type in TYPE_MAP:
return TYPE_MAP[slot_type] return TYPE_MAP[slot_type]
if isinstance(slot_type, list): if isinstance(slot_type, list):