This commit is contained in:
əlemi 2022-01-14 16:48:01 +01:00
parent 44db6927c4
commit a3f03756b6

View file

@ -125,12 +125,12 @@ class Enchantment:
type : EnchantmentType type : EnchantmentType
level : int level : int
def __init__(self, type:EnchantmentType=None, id:int=None, level:int=1): def __init__(self, type:EnchantmentType=None, id:int=None, lvl:int=1):
if not type and not id: if not type and not id:
raise ValueError("No enchantment type or enchantment id provided") raise ValueError("No enchantment type or enchantment id provided")
self.type = type or EnchantmentType(id) self.type = type or EnchantmentType(id)
self.eid = self.type.value self.eid = self.type.value
self.level = level self.level = lvl
def repr(self) -> str: def repr(self) -> str:
return f"<Enchantment({str(self)})>" return f"<Enchantment({str(self)})>"