specify is not None

This commit is contained in:
əlemi 2022-01-15 20:55:15 +01:00
parent 416b545e46
commit f35f9d5434

View file

@ -126,7 +126,7 @@ class Enchantment:
level : int level : int
def __init__(self, type:EnchantmentType=None, id:int=None, lvl:int=1): def __init__(self, type:EnchantmentType=None, id:int=None, lvl:int=1):
if not type and not id: if type is None and id is None:
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